IBM Support

Using Commands with a List Parameter in a CL Program

Troubleshooting


Problem

Commands like SNDDST and SNDNETF have a parameter that can use a list of items. These are usually lists of addresses. A CL program technique cannot be used to send to multiple addresses. The command fails with message CPD0074.

Resolving The Problem

Commands like SNDDST and SNDNETF have a parameter that can use a list of items. These are usually lists of addresses. A CL program technique cannot be used to send to multiple addresses. The command fails with message CPD0074.

PGM

             DCL        VAR(&TOADDR) TYPE(*CHAR) LEN(9999)
             DCL        Var(&Address) Type(*char) Len(44)
             DCLF       FILE(*LIBL/EMAILLST) RCDFMT(EMAILLSTR)
             CHGVAR     VAR(&ADDRESS) VALUE('(')
             CHGVAR     VAR(&TOADDR) VALUE(&TOADDR |< &ADDRESS)
 AGAIN:      Rcvf       RCDFMT(emaillstR)
 EOF:        Monmsg     CPF0864 EXEC(DO)
             ChgVar     VAR(&ADDRESS) +
                        VALUE('  (' || &EMAIL |< ' *BCC' || ') ')
             ChgVar     VAR(&TOADDR) VALUE(&TOADDR |< &ADDRESS)
             Goto       CMDLBL(SendEMail)
                        EndDo
             ChgVar     VAR(&ADDRESS) VALUE( +
                        '  (' || &EMAIL |< ' *BCC' || ') ')
             ChgVar     VAR(&TOADDR) VALUE(&TOADDR |< &ADDRESS)
             Goto       AGAIN
  SendEmail:
             CHGVAR     VAR(&ADDRESS) VALUE(')')
             CHGVAR     VAR(&TOADDR) VALUE(&TOADDR |< &ADDRESS)
             SNDDST     TYPE(*LMSG) +
                          TOINTNET(&ToAddr) +
                          DSTD('E-Statement Notification') +
                          LONGMSG('Your Statement is available +
                                   to View at                  +
                          http://www.cuathome.org              +
                                                               +
                                  ')
 EXIT:
             RETURN
             ENDPGM

The command processor can not differentiate between the addresses. Rather, use the QCMDEXEC to handle this command:

DCL        VAR(&TOADDR) TYPE(*CHAR) LEN(100) +              
             VALUE('(test01@devtest.cubase.org *BCC)  +    
             (test02@dest.cubase.org *BCC)')                
DCL        VAR(&SEC) TYPE(*DEC) LEN(15 5)  VALUE(300)      
DCL        VAR(&FIRST) TYPE(*CHAR) LEN(300)                
DCL        VAR(&DSTD) TYPE(*CHAR) LEN(30) +                
             VALUE('''E-STATEMENT NOTIFICATION''')          
DCL        VAR(&LONGMSG) TYPE(*CHAR) LEN(80) +              
             VALUE('''YOUR STATEMENT IS AVAILABLE TO +      
             VIEW AT HTTP://WWW.CUATHOME.ORG''')            
                                                           
CHGVAR     VAR(&FIRST) VALUE('SNDDST TYPE(*LMSG) +          
             TOINTNET(' *CAT &TOADDR *CAT ')' *BCAT +      
             'DSTD(' *CAT &DSTD *CAT ')' *BCAT +            
             'LONGMSG(' *CAT &LONGMSG *CAT ')')            
DMPCLPGM                                                    
CALL       PGM(QCMDEXC) PARM(&FIRST &SEC)

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Historical Number

26050157

Document Information

More support for:
IBM i

Software version:
7.1.0

Operating system(s):
IBM i

Document number:
640631

Modified date:
18 December 2019

UID

nas8N1017071

Manage My Notification Subscriptions