You need to understand the concepts of basic error trapping.

Ok, so you put a MONMSG in your CL to trap for some stuff, that's a start. 
 Although why one would monitor for CPFA09C - "Not authorized" and then 
act as if everything was fine escapes me.  I might be tempted to add 
another parameter that says whether or not the CPY ended successfully. 
Other possibilities for monitoring include What about if &PDFFILE is not 
there?

Ok, back to the basics.
- What error are you seeing in your joblog?
- Can you change the RPG to call(e), and then look at the contents of your 
PSDS for the exception message, and the exception message data?
- I would use all upper case on your call instead of 'rename'.  This can 
make a difference when you start into subprocedures and the like.  Not 
sure if that is your concern here.

Another possible technique.  Do away with the CL.  Instead use QCMDEXC. 
Again, you could use the psds for some error handling
callp(e) qcmdexc(cmd:cmdlen);
if %error;
  Select;
  When psds.exceptionMsg='CPFA09C';
    // Not authorized to the 'from' file
  When psds.exceptionMsg='CPFA0A9';
    // From object not found
  Other;
    // All others
  EndSl;
EndIf;

By the way, if you truly want to 'rename', why are you using CPY instead 
of RNM?

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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.