×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




If you're already using OVRSCOPE(*JOB) then other suggestions may be more 
applicable.

Here's a sample of the use of system():

     H Bnddir('QC2LE')
     ...
      * Execute Command (system) Subprocedure Variables
     D System          PR            10I 0 ExtProc('system')
     D  CmdText                        *   Value Options(*String)      
Command text string

     D ErrorCPF        S              7A   Import('_EXCP_MSGID')      
Error number
     D ErrorFlag       S             10I 0 Inz(0)      Error flag
     ...
       cmd='DLTF FILE(QTEMP/JOBLOG)';
       errorflag=system(cmd);
       Select;
       When errorflag=*zeros;
        // ran ok
       When errorcpf='CPF2105'; // object not found
        // This is ok.
       Other;  // oh crud!
        // Could be anything, including security
        Subject='Cannot attempt to count messages';
        Body=%trim(cmd) + ' ended with ' + ErrorCpf +
             ' <NL> ' + %trim(%EDITC(JOB_NUM:'X')) + '/' +
              %trim(USER) + '/' + %trim(JOB_NAME);
        alert(Subject:Body);
        return;
       EndSl;

Note:  The H spec and the D specs are NOT optional.

system()
Pros:
     Respects scoping.
Cons:
     QCMDEXC will fill in part of the PSDS with the message data.  For 
example if you got a CPF.... message you could analyze the return code in 
the message data in the PSDS to see why you got that message.

Rob Berendt

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.