|
Hello Jeff, You wrote: >/* MOVE TO PARMS - THE MCH3601 IS FOR A NULL PTR. IF THE COMMAND */ >/* DID NOT REQUEST A PARTICULAR VARIABLE, THE */ >/* MCH3601 WILL OCCUR. */ > CHGVAR VAR(&IPNAME) VALUE(&RIPNAME) > MONMSG MSGID(MCH3601) You should also remove the MCH3601 message from the joblog. There is no point in cluttering the joblog with unnecessary messages. That is the difference between a good programmer and a merely competent one. You should be coding: CHGVAR VAR(&IPNAME) VALUE(&RIPNAME) MONMSG MSGID(MCH3601) EXEC(DO) RCVMSG MSGTYPE(*EXCP) ENDDO or MONMSG MSGID(MCH3601) EXEC(RCVMSG MSGTYPE(*EXCP)) The same thing is true for all instances where messages are monitored and handled in the program. A classic example is CHKOBJ followed by MONMSG and then a CRTxxx command. Clean up the joblog. A certain automated operations software house should practice this technique. Also, since the real work is done in the RPG program and the sole purpose of the CLP is to call the RPG and handle the parameters you could use the RPG program as the Command Processing Program directly. Use the %ADDR built-in function to test the parameter before assigning a value to it. Of course that means the parameter names must be different from the database names but that is a GOOD THING. For example: /TITLE 'Retrieve OrderWriter Control Record /COPY QRPGSRC,HDefault FACCSCNT IF E DISK UsrOpn D @No C 'N' D @Yes C 'Y' D P_IPNAME S LIKE(IPNAME) etc, etc, etc. D P_OWCtlFnd S 1 C/EJECT C *ENTRY Plist C Parm P_IPNAME C Parm P_IPADRS C Parm P_ACSUSR C Parm P_ACSPWD C Parm P_HSTUSR C Parm P_HSTPWD C Parm P_ACSDLPTH C Parm P_ACSULPTH C Parm P_IFSDLPTH C Parm P_IFSULPTH C Parm P_OWCtlFnd /FREE // Get control record Open ACCSCNT; CHAIN 1 ACCSCNT; // Set return values if found If %Found(ACCSCNT); if (%ADDR(P_IPNAME) <> *NULL); P_IPNAME = IPNAME; endif; etc, etc, etc. if (%ADDR(P_OWCtlFnd) <> *NULL); P_OWCtlFnd = @Yes; endif; // END THE JOB Close ACCSCNT; *INLR = *On; Return; /END-FREE C *INZSR BEGSR /FREE if (%ADDR(P_IPNAME) <> *NULL); P_IPNAME = *BLANKS; endif; etc, etc, etc. if (%ADDR(P_OWCtlFnd) <> *NULL); P_OWCtlFnd = @No; // or *BLANK endif; /END-FREE C ENDSR Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.