A Sample Program SAMP7 Transaction-id SM07 IDENTIFICATION DIVISION. PROGRAM-ID. SAMP...
A Sample Program
SAMP7 Transaction-id SM07
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMP7.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 LINE1 PIC X(80) VALUE
"//SCB000JB JOB (SCB-SCB-SCB000-XXX-999),CLASS=C,".
01 LINE2 PIC X(80) VALUE
"// MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=SCB000,".
01 LINE2A PIC X(80) VALUE
"// USER=SCB000,PASSWORD=PAPA15A1".
01 LINE3 PIC X(80) VALUE
"//STEP1 EXEC PGM=IDCAMS".
01 LINE4 PIC X(80) VALUE
"//SYSPRINT DD SYSOUT=*".
01 LINE5 PIC X(80) VALUE
"//SYSIN DD *".
01 LINE6 PIC X(80) VALUE
" PRINT INDATASET(SCB000.PRODUCT) CHAR".
01 LINE7 PIC X(80) VALUE
"//".
01 RESP PIC 9(8) COMP.
01 RESP2 PIC 9(8) COMP.
01 TOKEN PIC X(8).
01 OUTLEN PIC S9(8) COMP VALUE +80.
01 WS-COUNT PIC S9(8) COMP.
77 OUTPRT PIC X(80) VALUE
'SPOOLOPEN FUNCTIONING'.
01 WS-VARS.
03 WS-RESP PIC S9(08) COMP VALUE 0.
LINKAGE SECTION.
PROCEDURE DIVISION.
PERFORM MAIN-PARA.
PERFORM END-PARA.
MAIN-PARA.
EXEC CICS SPOOLOPEN OUTPUT
NODE ('HCLIBM')
USERID ('INTRDR')
RESP(RESP) RESP2(RESP2)
TOKEN(TOKEN)
END-EXEC.
PERFORM LOOP-PARA
EXEC CICS SPOOLCLOSE
TOKEN(TOKEN)
RESP(RESP) RESP2(RESP2)
END-EXEC.
LOOP-PARA.
EXEC CICS SPOOLWRITE
FROM(LINE1)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE2)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE2A)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE3)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE4)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE5)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE6)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE7)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC.
END-PARA.
EXEC CICS
RETURN
END-EXEC.
SAMP6 transaction-id SM06
The following program is ATI’D from L86P. Use CEMT INQ TDQUEUE(L86P) to inquire and then disable the queue. Then discard the resource. Use CEDA to alter L86P definition and set Transaction-id toSM06. Make sure that ATIFACILITY is set to FILE and FACILITYID is set to NULL. Install the definition again.
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMP6.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 LINE1 PIC X(80) VALUE
"//KAMATH1 JOB CLASS=A,MSGLEVEL=(1,1),".
01 LINE2 PIC X(80) VALUE
"// MSGCLASS=X,NOTIFY=KAMATH,".
01 LINE2A PIC X(80) VALUE
"// USER=KAMATH,PASSWORD=PAPA19A".
01 LINE3 PIC X(80) VALUE
"//STEP1 EXEC PGM=IDCAMS".
01 LINE4 PIC X(80) VALUE
"//SYSPRINT DD SYSOUT=*".
01 LINE5 PIC X(80) VALUE
"//SYSIN DD *".
01 LINE6 PIC X(80) VALUE
" REPRO INFILE(IN) OUTFILE(SYSP)".
01 LINE7 PIC X(80) VALUE
"/*".
01 LINE8 PIC X(80) VALUE
"//SYSP DD SYSOUT=*".
01 LINE9 PIC X(80) VALUE
"//IN DD *".
01 LINE10 PIC X(80) VALUE
"/*".
01 LINE11 PIC X(80) VALUE
"//".
01 RESP PIC 9(8) COMP.
01 RESP2 PIC 9(8) COMP.
01 TOKEN PIC X(8).
01 OUTLEN PIC S9(8) COMP VALUE +80.
01 WS-COUNT PIC S9(8) COMP.
01 WS-VARS.
03 WS-RESP PIC S9(08) COMP VALUE 0.
03 WS-LINE-LENGTH PIC S9(08).
03 WS-BUFF PIC X(80) VALUE " ".
03 WS-DESTINATION-ID PIC X(4) VALUE "L86P".
01 WS-FLAGS.
03 WS-FLAG PIC S9(08) COMP VALUE 0.
LINKAGE SECTION.
PROCEDURE DIVISION.
PERFORM MAIN-PARA.
PERFORM END-PARA.
MAIN-PARA.
EXEC CICS SPOOLOPEN OUTPUT
NODE ('HCLDX390')
USERID ('INTRDR')
RESP(RESP) RESP2(RESP2)
TOKEN(TOKEN)
END-EXEC.
PERFORM LOOP-PARA
EXEC CICS SPOOLCLOSE
TOKEN(TOKEN)
RESP(RESP) RESP2(RESP2)
END-EXEC.
LOOP-PARA.
EXEC CICS SPOOLWRITE
FROM(LINE1)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE2)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE2A)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE3)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE4)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE5)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE6)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE7)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE8)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE9)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
PERFORM READTDQ UNTIL WS-FLAG = 1
EXEC CICS SPOOLWRITE
FROM(LINE10)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
EXEC CICS SPOOLWRITE
FROM(LINE11)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC.
READTDQ.
MOVE SPACES TO WS-BUFF
MOVE 80 TO WS-LINE-LENGTH
EXEC CICS
READQ TD QUEUE(WS-DESTINATION-ID)
INTO(WS-BUFF)
LENGTH(WS-LINE-LENGTH)
RESP(RESP)
END-EXEC
IF RESP = DFHRESP(NORMAL)
MOVE 80 TO OUTLEN
EXEC CICS SPOOLWRITE
FROM(WS-BUFF)
RESP(RESP) RESP2(RESP2)
FLENGTH(OUTLEN)
TOKEN(TOKEN)
END-EXEC
ELSE
MOVE 1 TO WS-FLAG
END-IF.
*
END-PARA.
EXEC CICS
RETURN
END-EXEC.
No comments
Post a Comment