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

Using and Dynamic JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Thu Oct 30, 2014 12:26 am
Reply with quote

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
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Thu Oct 30, 2014 2:36 pm
Reply with quote

Hi Basha,

Welcome to this forum icon_smile.gif


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
View user's profile Send private message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 184
Location: India

PostPosted: Thu Oct 30, 2014 4:11 pm
Reply with quote

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
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Thu Oct 30, 2014 6:48 pm
Reply with quote

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 icon_smile.gif
Basha
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Oct 30, 2014 6:56 pm
Reply with quote

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
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Fri Oct 31, 2014 12:07 am
Reply with quote

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
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 63
Location: India

PostPosted: Fri Oct 31, 2014 1:12 am
Reply with quote

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
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Fri Oct 31, 2014 1:29 am
Reply with quote

Thanks a lot Arun :-D .

I would definitely try this and share the challenges if any.

Thanks all.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts JCL Dynamic System Symbols JCL & VSAM 3
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
No new posts Dynamic file allocation using JCL JCL & VSAM 8
No new posts Dynamic Sortin DD cards SYNCSORT 8
Search our Forums:

Back to Top