* ------------------------------------------------------------- * IDENTIFICATION DIVISION. * ------------------------------------------------------------- * PROGRAM-ID. COBPASS. * ------------------------------------------------------------- * ENVIRONMENT DIVISION. * ------------------------------------------------------------- * DATA DIVISION. * ------------------------------------------------------------- * WORKING-STORAGE SECTION. * ------------------------------------------------------------- * * * W00 - General work fields * 01 W00-RC PIC S9(04) BINARY VALUE ZERO. * * W02 - Data fields derived from the PARM field * 01 W02-QMGR PIC X(48) VALUE SPACES. 01 W02-QUEUE PIC X(48) VALUE SPACES. * ------------------------------------------------------------- * LINKAGE SECTION. * ------------------------------------------------------------- * 01 PARMDATA. 05 PARM-LEN PIC S9(03) BINARY. 05 PARM-STRING PIC X(100). * EJECT * ------------------------------------------------------------- * PROCEDURE DIVISION USING PARMDATA. * ------------------------------------------------------------- * A-MAIN SECTION. * ------------------------------------------------------------- * * * If no data was passed, display a message and exit rc=16 * IF PARM-LEN = 0 THEN DISPLAY 'No parms passed to program' MOVE '16' TO W00-RC GO TO A-MAIN-END END-IF. * * Separate into the relevant fields any data passed in the * PARM statement * UNSTRING PARM-STRING DELIMITED BY ALL ',' INTO W02-QMGR W02-QUEUE. DISPLAY 'Queue manager name passed = ' W02-QMGR. IF W02-QUEUE = SPACES THEN DISPLAY 'No queue name passed to program' MOVE '16' TO W00-RC GO TO A-MAIN-END END-IF. DISPLAY 'Queue name passed = ' W02-QUEUE. A-MAIN-END. * * Set the return code * MOVE W00-RC to RETURN-CODE. STOP RUN.