MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get value from file & use it is a symbolic variable for

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Thu Apr 13, 2017 11:16 pm    Post subject: Get value from file & use it is a symbolic variable for Reply with quote

Hallo,
Good Morning, I have a requirement to fetch a value from the first record in the input file and use that value as a symbolic variable to generate the dataset names in the subsequent steps.

I understand that I can achieve this as follows:
1) 1st step of the JOBA - Get the value from the file and build the SET statement and write it to a PDS member - PDS.LIBRARY(NAMEDS).

For instance // SET NAME=LENOVO

2) 2nd step of the JOBA - Use program like EZACFSM1 and provide a new job JOBB in the instream data and mention the JCLLIB and Include the member (NAMEDS) generated in 1st step and use the symbolic variable in the DSname of the new job and write the output of this JOBA step to internal reader

Code:

//STEPXX  EXEC PGM=EZACFSM1
//SYSOUT   DD SYSOUT=(*,INTRDR)
//SYSIN    DD DATA,DLM=##
//JOBB    JOB 00000000,
//          MSGCLASS=X,
//         CLASS=Q
//LBDPROC JCLLIB ORDER=PDS.LIBRARY
//*
//        INCLUDE MEMBER=NAMEDS
//*
//JSTEP01     EXEC PGM=IEFBR14
//FILE01      DD   DSN=TEST.A&NAME..FILE,
//            DISP=(MOD,DELETE,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(1,1),RLSE)
//*
##


My question:
I know this works but it will generate 2 jobs - JOBA & JOBB. So my question is...is there anyway we can avoid writing the JOBB to internal reader and use the symbolic variable from the first step of JOBA in the subsequent steps.

Thanks in advance[/code]
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Apr 14, 2017 3:57 am    Post subject: Reply with quote

No - once the job has been submitted then the JCL is finalised. The only 'changes' possible are dynamic data set allocation.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Fri Apr 14, 2017 7:52 am    Post subject: Reply with quote

Thanks Nic Clouston for your thoughts...Can you please share a sample JCL of how to achieve this in a single job instead of creating 2 jobs...Thanks...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Apr 14, 2017 11:53 am    Post subject: Reply with quote

lal wrote:
Thanks Nic Clouston for your thoughts...Can you please share a sample JCL of how to achieve this in a single job instead of creating 2 jobs...Thanks...


lal,

I never understood the fascination of 1 job/step.

Either way if you insist on creating 1 job, then don't bother about the set statement. Generate IDCAMS/TSO Commands to define the new dataset. You can allocate a dataset in many ways. Change the program/utility that generates the SET statements to generate IDCAMS/TSO commands and use them in the same job. Quite simple exercise.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Mon Apr 17, 2017 12:51 am    Post subject: Reply with quote

Hi Kolusu,
Thanks for the response and Sorry, if the question/reply was bit cryptic...

The reason I prefer single job is that I need to build a generic job to be used to work with different kinds of data and also if feasible schedule that
job in the scheduler with predecessor/successor jobs.

For instance if the input file contains key word 'Lenovo' I need to process the data for 'Lenovo' and run 4 to 5 steps for this input file and generate
different GDG's (Some of these are tape datasets as they are used to store huge volume of data)

Here are preview of various job steps -
Input File - XXXXX.COMPANY.DATA

Step1: Take backup of input file
Input File: XXXXX.COMPANY.DATA
Output file: XXXXX.COMPANY.DATA.LENOVO.BKUP(+1)

Step2:
Input File: XXXXX.COMPANY.DATA.LENOVO.BKUP(+1)
Output files:
XXXXX.COMPANY.DATA.LENOVO.GOOD.RECS(+1)
XXXXX.COMPANY.DATA.LENOVO.BAD.RECS(+1)
XXXXX.COMPANY.DATA.LENOVO.SUSPENSE.RECS(+1)

Step3:
Input File:XXXXX.COMPANY.DATA.LENOVO.BAD.RECS(+1)
Output File: XXXXX.COMPANY.DATA.LENOVO.ERROR.REPORT(+1)

Job goes on for several steps working with the data processed by previous steps...


So this way input file contains data for various companies like Dell, HP and so on and everytime I need to process the data for specific companies and generate
company specific GDG's...

Please correct me if I am wrong, your suggestion would work if it's a sequential DASD dataset but not sure if it's feasible for GDG Tape datasets...Appreciate your response...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Apr 17, 2017 4:21 pm    Post subject: Reply with quote

lal wrote:
Hi Kolusu,
Thanks for the response and Sorry, if the question/reply was bit cryptic...

The reason I prefer single job is that I need to build a generic job to be used to work with different kinds of data and also if feasible schedule that
job in the scheduler with predecessor/successor jobs.


lal,

You mentioned that you have LENOVO in a dataset. So why not change the pgm that creates this dataset to create a PDS MEMBER instead of a dataset and it will have

Code:
// SET NAME=LENOVO


And you INCLUDE this member in your JCL. Then you will have just 1 job.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Tue Apr 18, 2017 12:12 am    Post subject: Reply with quote

Thanks a lot Kolusu for your suggestions...it sounds like we cannot create the PDS member with symbolic variable declaration/definition in the same job and use it. So the only way is to create PDS member in predecessor jobs...Thanks again...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group