IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Retrieve step name corresponding to a DDNAME in spool.


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun_scorpio

New User


Joined: 16 Oct 2009
Posts: 7
Location: India

PostPosted: Fri Jan 21, 2011 5:17 pm
Reply with quote

Hi,

I wanted to retrieve all the DDNAME and STEP NAME of a job using JOBID. I have written a REXX program to retrieve the DDNAME. But I dont know how to get the step names. After doing considerable search, I could not find any variables corresponding to step name.

I have posted below, the code, spool data, current output and expected output. Please take a look and let me know if there is a way to acheive it ?


Code:
/***************REXX**************/                         
RC = ISFCALLS(ON)                                           
ISFPREFIX = "A0101CM"                                       
ADDRESS SDSF "ISFEXEC ST"                                   
IF RC <> 0 THEN EXIT 20                                     
COUNT = ISFROWS                                             
JID = 'JOB24071'                                           
DO I = 1 TO COUNT                                           
 COLVAL = VALUE(JOBID.I)                                   
 IF COLVAL = JID THEN                                       
 DO                                                         
  ADDRESS SDSF "ISFACT ST TOKEN('"TOKEN.I"') PARM(NP ?)",   
  "("PREFIX JDS_                                           
  IF RC <> 0 THEN EXIT                                     
  DO J = 1 TO JDS_DDNAME.0                                 
   SAY JDS_DDNAME.J                                         
  END                                                       
 END                                                       
END                                                         
RC = ISFCALLS(OFF) 


Code:
Spool Screenshot :
DDNAME   StepName ProcStep DSID Owner    C Dest               Rec-Cnt
JESMSGLG JES2                 2 A0101    T LOCAL                   18
JESJCL   JES2                 3 A0101    T LOCAL                   19
JESYSMSG JES2                 4 A0101    T LOCAL                  138
OUTDD    SEC005             101 A0101    T LOCAL                  251
SYSUT2   STEP2              102 A0101    T LOCAL                    1
SYSPRINT STEP2              103 A0101    T LOCAL                   26



Code:
Current output:
JESMSGLG
JESJCL   
JESYSMSG
OUTDD   
SYSUT2   
SYSPRINT
***     


Code:
Expected output:
JESMSGLG JES2   
JESJCL      JES2   
JESYSMSG JES2   
OUTDD      SEC005
SYSUT2     STEP2 
SYSPRINT  STEP2
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jan 21, 2011 6:09 pm
Reply with quote

look for 7.2.5 Searching the report in this html version of Implementing REXX support in SDSF

this link will provide urls for html or pdf: www.redbooks.ibm.com/abstracts/sg247419.html?Open

and learn to use bbcode!!!!
Back to top
View user's profile Send private message
Jeffrey Ranney

New User


Joined: 23 Dec 2010
Posts: 20
Location: USA

PostPosted: Tue Feb 08, 2011 5:03 pm
Reply with quote

In the SDSF manual, it describes how run SDSF in batch. Here is some sample JCL from the job I use to do what you are attempting :

//*
//****---> LINES,WIDTH
//SDSF EXEC PGM=ISFAFD,PARM='++20,150'
//ISPPROF DD DISP=SHR,DSN=YOURTSOID.ISPF.ISPPROF
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//ISFOUT DD SYSOUT=*
//CAPTURE DD SYSOUT=*
//ISFIN DD *
PRE DZQ08K*
ST
PT FILE CAPTURE
FIND DZQ08KE1
++?
FIND JESMSGLG
++S
//
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Feb 09, 2011 3:20 am
Reply with quote

See Example 7-6, in www.redbooks.ibm.com/abstracts/sg247419.html?Open , which seems to do exactly what you want. It might also be good to review the other examples.
Back to top
View user's profile Send private message
Arun_scorpio

New User


Joined: 16 Oct 2009
Posts: 7
Location: India

PostPosted: Wed Feb 16, 2011 4:25 pm
Reply with quote

Pedro wrote:
See Example 7-6, in www.redbooks.ibm.com/abstracts/sg247419.html?Open , which seems to do exactly what you want. It might also be good to review the other examples.


Thanks mate.. Finally got what I had wanted...
Also came to know how to find the stem variable name for all the columns in SDSF.

Here is the code:
Code:

/***************REXX**************/                     
RC = ISFCALLS(ON)                                       
ISFPREFIX = "A0101SRT"                                   
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 = 'JOB27050' 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                                 
  END                                                   
 END                                                     
END                                                     
RC = ISFCALLS(OFF)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Using Java/C/C++ to retrieve dataset ... Java & MQSeries 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top