View previous topic :: View next topic
|
Author |
Message |
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi All,
I have been trying to develope a tool, which will find the particular dataset name in set of proc's.
I am using the below code to extract all PDS names.
//LISTDS EXEC PGM=IKJEFT1B
//SYSTSPRT DD DISP=SHR,DSN=XXX.BASHA.SRCHIN
//SYSTSIN DD *
EXEC 'XXX.BASHA.SRCHFOR.TOOL(LIST)' EXEC
WRCXXX*.*.*.PROCLIB
/*
LIST - this rexx will fetch all PDS names like 3.4. So this fetches 150 odd proc's.
//SRHCFOR EXEC PGM=ISRSUPC,PARM=(SRCHCMP,ANYC,IDPFX,NOPRTCC)
//NEWDD DD DISP=SHR,DSN=WXXXA.AAAA.PROCLIB
// DD DISP=SHR,DSN=WXXXB.BBBB.PROCLIB
// DD DISP=SHR,DSN=WXXXB.CCCC.PROCLIB
// DD DISP=SHR,DSN=WXXXB.DDDD.PROCLIB
//OUTDD DD DISP=SHR,DSN=XXX.BASHA.SRCHOUT
//SYSIN DD *
SRCHFOR 'Dataset Name'
/*
//
Above JCL searches the sting and give the lines in OUTDD.
Problems I face and Need help in below :
1. I want to code NEWDD dynamically, means I am not sure how many PDS step1 gives, so I want to give all dd names at run time to step2 NEWDD.
2. What ever result am getting as output it shows as searched from last DD -WXXXB.DDDD.PROCLIB, I want to extract the exact dd name where string found.
I have tried to search for the above someone advised to user dynamic JCL which I dont know. And am not familiar with REXX too.
Please help.
Thanks,
Basha. |
|
Back to top |
|
|
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
Hi Basha,
Welcome to this forum
Before I answer this I want to make sure what is your reqirement is.
I believe ultimately you want all the DD names ,a particular dataset is allocated
to in a set of proc libraries.
Also I hope what you have in 'XXX.BASHA.SRCHFOR.TOOL(LIST)' is
just a "LISTCAT" command. If so what is the below DD statement meant for?
Code: |
//SYSTSPRT DD DISP=SHR,DSN=XXX.BASHA.SRCHIN |
Thanks,
Arun |
|
Back to top |
|
|
satish.ms10
Active User
Joined: 10 Aug 2009 Posts: 184 Location: India
|
|
|
|
Hi Basha,
Hope I understood your requirement correctly. Here is my understandings:
1. LISTDS step gets all the PDS names that are matting with WRCXXX*.*.*.PROCLIB pattern by running LIST REXX program.
2. You need to add the PDS names, that are given the above program, to SRHCFOR step under NEWDD.
Am I correct here?
If yes, you can extend the LIST REXX program functionality to update the NEWDD in the JCL, that is having SRHCFOR step, with the list of dataset names that are matching with the given pattern. |
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi Sati,
Thanks for understanding my challenge correctly.
Do you want me to invoke srchfor step from REXX.
But i really dont know how to manage NEWDD.
If possible please explain me with a piece of code or examples how i could i achieve it.
Thanks
Basha |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
No such thing as 'dynamic' JCL. You can have dynamic allocation - in the programs that YOU write and those Utility programs that allow it e.g. the various sorts.
What you can do is write a program, it does not have to be in Rexx, that analysees the output of your first step and creates the JCL required to execute the SUPERC - one step per output file - and submit the generated job. Probably best to write it to a dataset whilst you are trying to get the thing to work and then either have your program/job submit the generated job or still have it written to a dataset and then do a manual submit. |
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Thanks all for your valuable response.
Hi Arun,
//SYSTSPRT DD DISP=SHR,DSN=XXX.BASHA.SRCHIN
XXX.BASHA.SRCHIN will have all the PDS names where
WXXXB.BBBB.PROCLIB
WXXXB.CCCC.PROCLIB
WXXXB.DDDD.PROCLIB copied manually to NEWDD from this dataset.
This I want to make this automated.
@Nic,
I understand that we cannot code dynamically. Is there any way that we can give NEWDD as SYSIN or Instearm.
Say like below
//SRHCFOR EXEC PGM=ISRSUPC,PARM=(SRCHCMP,ANYC,IDPFX,NOPRTCC)
//NEWDD DD *
WXXXB.BBBB.PROCLIB
WXXXB.CCCC.PROCLIB
WXXXB.DDDD.PROCLIB
//OUTDD DD DISP=SHR,DSN=XXX.BASHA.SRCHOUT
//SYSIN DD *
SRCHFOR 'Dataset Name'
/*
//
If above can be accomplished then I will use DFSORT - Outrec to edit and give PDS names to be searched.
Please advise. |
|
Back to top |
|
|
Arunkumar Chandrasekaran
New User
Joined: 01 Jun 2010 Posts: 63 Location: India
|
|
|
|
Hi Basha,
All you need is to code a rexx program.
Input to Rexx program - WRCXXX*.*.*.PROCLIB and Dataset Name
(1) first LISTCAT(WRCXXX*.*.*.PROCLIB) and get all librarys.
(2) Create the JCL statements in Rexx and write it to a PDS.Here you can
create the NEWDD dynamically based on the counts resulted in previous step.
Use looping from 1 to count and write one DD for each lib.
(3) You can even submit the JCL in rexx itself.
(4)If not JCL you can even call the Superc program from Rexx after allocating required DDs using TSO ALLOCATE.
(5)Now you wil have XXX.BASHA.SRCHOUT in your hand.But since you want DD names,some times DD names and DSNAMES may not be in same line like below.(remember Superc only list the line datasetname is present.)
Code: |
MYDD DD DISP=SHR,
DSN=MY.DATASET.NAME |
If so you cant get DD names from SUPERC list.
For that you need to get the corresponding proc lib using concate# and element name present in Superc list.read the elemnt and get the DD name where the dataset is refered.
I am sure this would help you much.let me know if you face any issue.
Thanks,
Arun |
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Thanks a lot Arun :-D .
I would definitely try this and share the challenges if any.
Thanks all. |
|
Back to top |
|
|
|