Please can anybody help me out in resolving this.
Currently I’m working on NATURAL & ADABAS. & I’m learning REXX only because of to implement this logic.
In a JOB, particularly I want to retain CMPR* named DDnames reset I want to delete.
>>> Input
DDname Stepname Procstep Status
JESMSGLG JES2 HELD
JESJCL JES2 HELD
JESYSMSG JES2 HELD
CMPLOG CCSSTART STEP1 HELD
DDPRINT CCSSTART STEP1 HELD
CMPRINT CCSSTART STEP1 HELD
CMPLOG SRA03301 STEP1 HELD
DDPRINT SRA03301 STEP1 HELD
CMPRINT SRA03301 STEP1 HELD
CMPLOG SRA03302 STEP1 HELD
JESMSGLG JES2 HELD
JESJCL JES2 HELD
JESYSMSG JES2 HELD
CMPLOG CCSSTART STEP1 HELD
DDPRINT CCSSTART STEP1 HELD
CMPRINT CCSSTART STEP1 HELD
CMPLOG SRA03301 STEP1 HELD
DDPRINT SRA03301 STEP1 HELD
CMPRINT SRA03301 STEP1 HELD
CMPLOG SRA03302 STEP1 HELD
I want to delete all these JESMSGLG, JESJCL
JESYSMSG, DDPRINT, CMPLOG using REXX.
>>> required output
DDname Stepname Procstep Status
CMPRINT CCSSTART STEP1 HELD
CMPRINT SRA03301 STEP1 HELD
I used below logic. To detect particular ddnames in a job. But I’m not able to delete them.
That’s giving error at ADDRESS TSO FREE F(ISFIN) DDN(STEPN.J)
/***************REXX**************/
/*TRACE C*/
SAY 'ENTER JOB-NAME AND JOB-ID'
PULL JOBNM JOBID
RC = ISFCALLS(ON)
/*ISFPREFIX = "TVDARPSD"*/
ISFPREFIX = JOBNM
ADDRESS SDSF "ISFEXEC ST"
IF RC <> 0 THEN
DO
SAY 'ERROR'
EXIT 20
END
LOOP = ISFROWS
DO I = 1 TO LOOP
COLVAL = VALUE(JOBID.I)
IF COLVAL = JOBID THEN
/* IF COLVAL = 'JOB21392' THEN */
DO
ADDRESS SDSF "ISFACT ST TOKEN('"TOKEN.I"') PARM(NP ?)"
IF RC <> 0 THEN EXIT
DO J = 1 TO STEPN.0
SAY DDNAME.J STEPN.J
IF DDNAME.J = 'CMPRINT' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT01' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT02' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT03' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT04' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT05' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT06' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT07' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT08' THEN
SAY 'RETAINED'
ELSE DO
ADDRESS TSO FREE F(ISFIN) DDN(STEPN.J)
SAY 'XXX --->>> DELETED'
SAY ' '
END
END
END
ELSE
DO
SAY 'JOB-NM TO BE DELETD IS NOT MATCHING WITH JOB-ID SPECIFIED'
END
END
RC = ISFCALLS(OFF)
/*TRACE C*/
SAY 'ENTER JOB-NAME AND JOB-ID'
PULL JOBNM JOBID
RC = ISFCALLS(ON)
/*ISFPREFIX = "TVDARPSD"*/
ISFPREFIX = JOBNM
ADDRESS SDSF "ISFEXEC ST"
IF RC <> 0 THEN
DO
SAY 'ERROR'
EXIT 20
END
LOOP = ISFROWS
DO I = 1 TO LOOP
COLVAL = VALUE(JOBID.I)
IF COLVAL = JOBID THEN
/* IF COLVAL = 'JOB21392' THEN */
DO
ADDRESS SDSF "ISFACT ST TOKEN('"TOKEN.I"') PARM(NP ?)"
IF RC <> 0 THEN EXIT
DO J = 1 TO STEPN.0
SAY DDNAME.J STEPN.J
IF DDNAME.J = 'CMPRINT' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT01' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT02' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT03' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT04' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT05' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT06' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT07' THEN
SAY 'RETAINED'
ELSE
IF DDNAME.J = 'CMPRT08' THEN
SAY 'RETAINED'
ELSE DO
ADDRESS TSO FREE F(ISFIN) DDN(STEPN.J)
SAY 'XXX --->>> DELETED'
SAY ' '
END
END
END
ELSE
DO
SAY 'JOB-NM TO BE DELETD IS NOT MATCHING WITH JOB-ID SPECIFIED'
END
END
RC = ISFCALLS(OFF)
Please anybody let me know how to delete/free a ddname from job(not from PDS).
Lakshmi