Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using and Dynamic JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 37
Location: India

PostPosted: Thu Oct 30, 2014 12:26 am    Post subject: Using and Dynamic JCL
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: 61
Location: India

PostPosted: Thu Oct 30, 2014 2:36 pm    Post subject:
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: 158
Location: India

PostPosted: Thu Oct 30, 2014 4:11 pm    Post subject:
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: 37
Location: India

PostPosted: Thu Oct 30, 2014 6:48 pm    Post subject:
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: 1716
Location: UK

PostPosted: Thu Oct 30, 2014 6:56 pm    Post subject: Reply to: Using and Dynamic JCL
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: 37
Location: India

PostPosted: Fri Oct 31, 2014 12:07 am    Post subject:
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: 61
Location: India

PostPosted: Fri Oct 31, 2014 1:12 am    Post subject:
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: 37
Location: India

PostPosted: Fri Oct 31, 2014 1:29 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Creating a dynamic sort card in JCL u... ChitraChhabra DFSORT/ICETOOL 4 Wed Aug 03, 2016 6:15 pm
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts Need to create file with Dynamic Name... kapil27 JCL & VSAM 4 Wed May 25, 2016 9:45 am
No new posts DB2 Stored Procedure - Dynamic SQL - ... GuyC DB2 2 Wed Feb 17, 2016 5:10 pm
No new posts Need help with Oracle Dynamic SQL: Me... Anoop Chandran1984 COBOL Programming 1 Sat Feb 13, 2016 7:27 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us