How to delete particular DDNAME/STEP from a job using REXX



IBM's Command List programming language & Restructured Extended Executor

How to delete particular DDNAME/STEP from a job using REXX

Postby Lakshmi M » Fri Mar 02, 2012 1:24 pm

Hi Everyone,

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


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) 



Please anybody let me know how to delete/free a ddname from job(not from PDS).

Lakshmi
Lakshmi M
 
Posts: 3
Joined: Wed Feb 29, 2012 4:59 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to delete particular DDNAME/STEP from a job using REXX

 

Re: How to delete particular DDNAME/STEP from a job using RE

Postby prino » Fri Mar 02, 2012 2:30 pm

As a minimum, this
ADDRESS SDSF "ISFEXEC ST"
needs to be
ADDRESS SDSF "ISFEXEC H"

You cannot free datasets, you can only purge them, and that can only be done from the "Held Output" panel.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: How to delete particular DDNAME/STEP from a job using RE

Postby Lakshmi M » Fri Mar 02, 2012 3:12 pm

Thanks a lot for your quick reply. i'm done with the changes suggested by you.
could you advise me through which command in REXX I can accomplish this purging.

i tried this
ELSE DO
ADDRESS 'TSO' PURGE DDNAME.J

instead of
ADDRESS TSO FREE F(ISFIN) DDN(STEPN.J)
But Its abending with RC code 3. then which is the command?!

* * * * * * * * * * * ** * * * * * * * * * ** *
SYSPRINT IDCAMSF
IKJ56500I COMMAND PURGE NOT FOUND
56 *-* ADDRESS 'TSO' PURGE DDNAME.J
+++ RC(-3) +++
XXX --->>> DELETED

* * * * * * * * * ** * * * ** * * ** * * ** * * ** * * ** * *
Lakshmi M
 
Posts: 3
Joined: Wed Feb 29, 2012 4:59 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to delete particular DDNAME/STEP from a job using RE

Postby Akatsukami » Fri Mar 02, 2012 4:20 pm

You do not want to issue commands to the TSO environment, you want to issue commands to the SDSF environment, using "ADDRESS SDSF".

We do not use SDSF at my site, so I don't have a link to the SDSF documentation handy, but I've no doubt that many here can provide you with one.

(ETA: I found a link. What you do with it is your concern.)
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: How to delete particular DDNAME/STEP from a job using RE

Postby Lakshmi M » Fri Mar 02, 2012 5:49 pm

It provided me a great information. :) i was working on it from many days and miracle happened in one day, that to i'm a beginner in REXX.
Finally i modeled my requirement and is working wonderful and this will be going to save lots of manual work in our team.

My many thanks to you Akatsukami.
Lakshmi M
 
Posts: 3
Joined: Wed Feb 29, 2012 4:59 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post