Mod - Job Submission From CICS
Mod - Job Submission From CICS
Mod - Job Submission From CICS
EXEC CICS
SPOOLCLOSE TOKEN(rp_token)
RESP(rs_field)
END-EXEC.
IDENTIFICATION DIVISION.
PROGRAM-ID.SPOOLTT.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-SPOOLVARS.
05 WS-TOK PIC X(08) VALUE SPACES.
05 WS-RESP PIC S9(04) COMP.
05 WS-NODE PIC X(08) VALUE ‘J2SIG ‘.
05 WS-READER PIC X(08) VALUE ‘INTRDR ‘.
01 WS-I PIC 9(02) VALUE 1.
Sample Program Continued ….
01 WS-JOBSTREAM.
05 WS-JOBSTMT PICTURE X(80)
VALUE ‘//TLPSC001 JOB (0807LS01),’’EMP PROCESSING’’,’.
05 WS-JOBAUTH PICTURE X(80)
VALUE ‘// CLASS=K,MSGCLASS=1,NOTIFY=TPE037’.
05 FILLER PICTURE X(80)
VALUE ‘//*’.
05 WS-JOBSTEP1 PICTURE X(80)
VALUE ‘//DELSTEP EXEC PGM=IEFBR14’.
05 WS-JOBSTEP2 PICTURE X(80)
VALUE ‘//DD01 DD DSN=TPE037.TEST.ERROR,’.
05 WS-JOBSTEP3 PICTURE X(80)
VALUE ‘// DISP=(,DELETE,DELETE), SPACE=(TRK,(1,1),RLSE)’.
05 FILLER PICTURE X(80)
VALUE ‘//*’.
01 WS-JOBSPOOL REDEFINES JOBSTREAM PIC X(80) OCCURS 7 TIMES.
Sample Program Continued ….
PROCEDURE DIVISION.
0000-MAIN-PARA.
PERFORM 1000-OPEN-SPOOL THRU 1000-EXIT.
PERFORM 2000-WRITE-SPOOL THRU 2000-EXIT UNTIL WS-I > 7.
PERFORM 3000-CLOSE-SPOOL THRU 3000-EXIT.
PERFORM 9999-STOP THRU 9999-EXIT.
0000-EXIT.
EXIT.
1000-OPEN-SPOOL.
EXEC CICS SPOOLOPEN OUTPUT NODE(WS-NODE)
TOKEN (WS-TOK)
USERID (WS-READER)
RESP(WS-RESP)
END-EXEC.
IF WS-RESP NOT = 0
PERFORM 9999-STOP THRU 9999-EXIT
END-IF.
1000-EXIT.
EXIT.
Sample Program Continued ….
2000-WRITE-SPOOL.
EXEC CICS SPOOLWRITE FROM(WS-JOBSPOOL(WS-I))
FLENGTH(80)
TOKEN(WS-TOK)
RESP(WS-RESP)
END-EXEC.
IF WS-RESP NOT = 0
PERFORM 9999-STOP THRU 9999-EXIT
END-IF.
ADD 1 TO WS-I
2000-EXIT.
EXIT.
Sample Program Continued ….
3000-CLOSE-SPOOL.
EXEC CICS SPOOLCLOSE TOKEN (WS-TOK)
RESP(WS-RESP)
END-EXEC.
IF WS-RESP NOT = 0
PERFORM 9999-STOP THRU 9999-EXIT
END-IF.
3000-EXIT.
EXIT.
9999-STOP.
EXEC CICS
RETURN
END-EXEC.
9999-EXIT.
EXIT.
Note: To write the entire JCL, SPOOL is opened once. SPOOLWRITE is
repeated for every line of JCL. Once all the lines are written to the spool,
it is closed.
Sample Program Continued ….
Shortfalls of TDQ :
• Single-threading queuing mechanisms within
applications to avoid interspersing one user's JCL with
that from another.
• Performance problems due to high transaction
volumes.
Shortfalls of TDQ :
• Single-threading queuing mechanisms within
applications to avoid interspersing one user's JCL with
that from another.
• Performance problems due to high transaction
volumes.