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

Needs to find DSNs that are catlg from PDS members(jobs)


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

New User


Joined: 19 Sep 2006
Posts: 46
Location: Australia

PostPosted: Thu Aug 23, 2007 6:21 pm
Reply with quote

Hi,

i have a pds contains the jobs. my requirement is here to pick one member name and browse it to find all the datasets that are catlg and write those dsn in a sequential file. PDS contains approx. 20,000 jobs. and i need to do for all the jobs. Hope you can understand what i want. Can any one please suggest the rexx solution for this.

Thanks in advance

Bhim
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 24, 2007 1:20 pm
Reply with quote

If you can tell us the requirement for this task, then maybe we can come up with some suggestions.

When you say jobs in your PDS, do you mean the JCL to execute these jobs ?
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: Australia

PostPosted: Fri Aug 24, 2007 6:08 pm
Reply with quote

Thanks for your response ... Now i have copied all the jobs(JCLs) in a sequential dataset by running a JCL. I am able to pick the job name. Below is my rexx..

Code:

/* REXX STP999*/                                 
dsndd = 'IN1' /*input dd name */                 
records.0 = 0                                     
rrc = 0                                           
rrc=read_list(dsndd)                             
mbr1=space(records.1,0) 
say mbr1                         
Read_List:                                       
  Arg wdd                                         
  "EXECIO * DISKR "wdd" (STEM records. FINIS"                                     
  If records.0 = 0 Then Do                       
   Say 'Input DSN base file (DDNAME 'wdd') is empty'
     Say 'Aborting.'                             
     Return 151                                   
  End                                             
Return 0                                         


I am getting member name mbr1 in the output. Member is JCL. Now I want to browse it to read its record to find DSN's that are CATLG like..

Code:
//INOUTDS3 DD   DSN=XXXX.ABC002.XYZ,DISP=(,CATLG),


and then want to write XXXX.ABC002.XYZ in another sequential dataset.
[/code]
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Aug 24, 2007 7:03 pm
Reply with quote

It is not going to be simple, DSN and DISP may not always be on the same line. You also need to handle PROCs, overrides, and symbolic parameters. And there is always dynamic allocations. Have fun, you have along ways to go.
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: Australia

PostPosted: Fri Aug 24, 2007 7:40 pm
Reply with quote

I have done that in PL1 now I am trying to submit JCL through REXX. below is my code ...

Code:
/* REXX STP999*/                                                       
/* ****************************************************************** */
dsndd = 'IN1' /*input dd name */                                       
records.0 = 0                                                           
rrc = 0                                                                 
rrc=read_list(dsndd)                                                   
mbr1=space(records.1,0)                                                 
say mbr1                                                               
say length(mbr1)                                                       
call call_jcl                                                           
/* display list of the files existing on MVS */                         
Read_List:                                                             
  Arg wdd                                                               
  "EXECIO * DISKR "wdd" (STEM records. FINIS"                           
  SAY RECORDS.0                                                         
  If records.0 = 0 Then Do     
   Say 'Input DSN base file (DDNAME 'wdd') is emp'             
     Say 'Aborting.'                                           
     Return 151                                               
  End                                                         
call_jcl:                                                     
address tso                                                   
"SUBMIT *"                                                     
//XXXXXXA JOB (ACCOUNT),'PGMR ',MSGCLASS=V,                 
//         CLASS=H,NOTIFY=ZID, MSGLEVEL=1                   
//JOBLIB   DD   DSN=ZID.TEST.LOADLIB,DISP=SHR             
//         DD   DSN=ABC.COMMON.XXX.LOADLIB,DISP=SHR           
//         DD   DSN=ABC.XXX.COMMON.PRDA.LOADLIB,DISP=SHR     
//STEP1    EXEC PGM=STEP1,REGION=2M                           
//INFILE   DD   DSN=ZID.TEST.CNTLLIB(member),DISP=SHR     
//OUTFILE  DD   DSN=ZID.GDG.CATLG,DISP=(MOD,CATLG),       
//             DATACLAS=TINY,RECFM=FB,LRECL=40,               
//             STORCLAS=SCPRIME                               
//PLIDUMP  DD   SYSOUT=*,                                     
//PLIDUMP  DD   SYSOUT=*,                               
//             RECFM=FBA,LRECL=133                       
//SYSOUT   DD   SYSOUT=*,                               
//             RECFM=FBA,LRECL=133                       
//SYSPRINT DD   SYSOUT=*,                               
//             RECFM=FBA,LRECL=133                       
//SYSUDUMP DD   SYSOUT=*,                               
//             RECFM=FBA,LRECL=133                       
//FAIL002  EXEC PGM=STEPFAIL,REGION=2M,COND=(0,EQ,STEP1)
return rc                                               
Return 0   


But I am getting the error in the ouput :
Code:

READY                                                                           
 EX 'ZID.CLISTLIB.CLIST(STP99)'                                             
21526                                                                           
IN1                                                                             
IKJ56274A ENTER INPUT JOB STREAM:                                               
    28 +++  //XXXXXXA JOB (ACCOUNT),'PGMR ',MSGCLASS=V,                 
//         CLASS=H,NOTIFY
     8 +++ rrc=read_list(dsndd)                                                 
IRX0035I Error running STP99, line 28: Invalid expression                       
READY                                                                           
END     


I searched the forum to submit the JCL through rexx but yet have not got the proper solution for this. Please suggest.
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: Australia

PostPosted: Fri Aug 24, 2007 7:47 pm
Reply with quote

sorry ... i frogt to change
Code:
DSN=ZID.TEST.CNTLLIB(member),DISP=SHR

with
Code:
DSN=ZID.TEST.CNTLLIB(mbr1),DISP=SHR
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 Finding and researching jobs All Other Mainframe Topics 0
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
No new posts Find the size of a PS file before rea... COBOL Programming 13
Search our Forums:

Back to Top