IBM CDI5UG1107 Computer Accessories User Manual


 
16 IBM Sterling Connect:Direct for i5/OS User’s Guide
&MSGID is the CDE* error message. The first 8 characters of the &MSGDATA are the application error
message that you can look up interactively with the following command:
Using CL Programming and Sterling Connect:Direct CL Commands
An i5/OS CL program includes Sterling Connect:Direct CL commands as source statements. You can
synchronize the processing of Sterling Connect:Direct operations by including Sterling Connect:Direct CL
commands in a CL program.
Sample CL Program
The following figure shows a sample CL program with multiple CL commands:
DSPCDMSGD <msgid>
Note: The &MSGID and &MSGDATA variables must be defined in the CL program. Specify the &MSGID
character length as 7 characters and &MSGDATA as 8 characters to capture the error message.
Note: If you are using the Source Edit Utility (SEU) to edit a CL program, the prompt facility can help you
type all CL commands, including Sterling Connect:Direct CL commands.
PGM PARM(&LIBNAME &FILENAME &MBRNAME)
DCL VAR(&LIBNAME) TYPE(*CHAR) LEN(10)
DCL VAR(&FILENAME) TYPE(*CHAR) LEN(10)
DCL VAR(&MBRNAME) TYPE(*CHAR) LEN(10)
DCL VAR(&FDSN) TYPE(*CHAR) LEN(32)
/* BUILD THE FDSN VARIABLE */
CHGVAR VAR(&FDSN) VALUE(&LIBNAME *TCAT '/' *CAT +
&FILENAME *TCAT '(' *CAT &MBRNAME *TCAT +
')')
/* SEND THE FILE MEMBER */
CDSND SNODE('CDSERVER.V4100') +
SNODENVIRN(WINDOWS) FDSN(&FDSN) +
TDSN('Send_Test.TXT') +
FMSYSOPTS('TYPE(MBR)') +
TOSYSOPTS('DATATYPE(TEXT)')
MONMSG MSGID(CDE0000) EXEC(GOTO CMDLBL(ERROR))
GOTO END
ERROR: SNDMSG MSG('The process erred') TOUSR(*SYSOPR)
END: ENDPGM