Page 1 of 1

How to get values from a dataset with JCL

PostPosted: Tue Feb 06, 2018 7:33 am
by clesilva11
Hello All,

I am a beginner with JCL, and i have the JCL below to define the ALIAS to a new TSO ID....

//JOBNAME   JOB CLASS=S,MSGCLASS=X,NOTIFY=USERID              
/*JOBPARM SYSAFF=LPAR                                        
//TSOBATCH  EXEC PGM=IKJEFT01,DYNAMNBR=30,TIME=1440            
//SYSTSPRT  DD  DSN=USERID.ALIAS.TXT,                          
//          DISP=(NEW,CATLG),DCB=(RECFM=FB,LRECL=133)          
//*YSTSPRT  DD  SYSOUT=*                                        
//SYSPRINT  DD SYSOUT=*                                        
//SYSTSIN   DD *                                                
DEFINE ALIAS(NAME('USERID') RELATE('CATALOG'))  



But in this case, I would like to know how this JCL can read a dataset with a lot of IDs, to define the ALIAS to all those IDs.
This dataset with IDs organized as follows:

'USERID1',
'USERID2',
'USERID3',
'USERID4'



I saw another JCL with this same structure, but I couldn't copy the content for business restrictions.
Somebody could you please help me with this question?

Thank you so much for all attention.

Edited to use code tags

Re: How to get values from a dataset with JCL

PostPosted: Tue Feb 06, 2018 1:45 pm
by willy jensen
Well, JCL can certainly refer to a dataset with your commands in it. So use you favorite editor to change the dataset with the userids to a list of the actual DEFINE commands, then change the SYSTSIN DD to refer to that dataset. You cannot use JCL to build your commands, for that you need a program.

Re: How to get values from a dataset with JCL

PostPosted: Tue Feb 06, 2018 4:37 pm
by NicC
Please use the code tags to present data, code, screen 'shots' (cut'n'paste) or anything else requiring a fixed pitch font as seen on your terminal.
code tag format:
start:- open square bracket([),"code",close square brackets(])
end :- open square bracket([),"/code",close square brackets(])
concatenate all together without the double quotes or commas.

Many people seem to mis-understand what JCL is.
Although the 'L' in JCL stands for 'Language' JCL is not executable.
JCL does not manipulate data, it does not even look at data.
JCL is like a memo from you to the Operating System (OS) requesting it (the OS) to run one or more programs.
The JCL specifies some, or all, the resources required to accomplish the requested tasks.
When the JCL is read the OS reads it and sets up whatever it requires to do the tasks defined in the JCL.
It then DISCARDS the JCL, i.e. writes it to the output spool, never to look at it again.
The OS then runs the program(s) in accordance with the information it has extracted.