Page 1 of 2

substitute into JCL varying by job

PostPosted: Wed Aug 31, 2016 10:43 pm
by KGherlone
Hello all,
We have a requirement to automatedly remove terminated users from RACF. This cannot be done if there are any files allocated to that user, whos ID is the High Level qualifier for the files. I have some JCL that would 1)recall any migrated files for the HLQ 2) copy the files for that HLQ for archive purposes then 3) delete all the file with the HLQ. A file is populated with the value of the HLQ to delete, but my issue is getting the value from that file to the JCL needed on a variable basis. For Example here is the recall step:
//*********************************************************************
//* -STEP- -PROGRAM- -DESCRIPTION-
//* STEP0010 IKJEFT01 RECALL FILES BY HL QUALIFIER
//*********************************************************************
//*
//STEP0010 EXEC PGM=IKJEFT01
//SYSTSIN DD *
HRECALL P13KGH.**' WAIT
/*
//SYSTSPRT DD DISP=(,CATLG,DELETE),DSN=PSTSM.RCALLRPT.P13KGH,
// DCB=(RECFM=FB,LRECL=132),
// SPACE=(CYL,(10,1),RLSE)

Where P13KGH is the value to be provided for each run.
How can I get this HLQ variable into the JCL on a run by run basis.
Thanks,
Kevin
//SYSOUT DD SYSOUT=*

Re: substitute into JCL varying by job

PostPosted: Wed Aug 31, 2016 11:28 pm
by Akatsukami
Would making the steps into a proc, substituting the HLQ with a variable, and updating a SET statement manually fulfill your requirement?

Re: substitute into JCL varying by job

PostPosted: Wed Aug 31, 2016 11:55 pm
by KGherlone
Using a PROC and manually substituting a variable would not handle the requirement, which is a hands-off removal of any trace of a User when they are terminated. When a User is dropped from the Novel Active Directory a file will be created with the terminated User ID. This file will be interrogated and the hope is to then programmatically populate a variable with that value. The jcl then would use this value as a substitution variable in the recall, copy and delete steps.
Kevin

Re: substitute into JCL varying by job

PostPosted: Thu Sep 01, 2016 12:25 am
by Robert Sample
my issue is getting the value from that file to the JCL needed on a variable basis
Write a program in the language of your choice to read the user id from the data set (the only files in z/OS are on tape or in Unix System Services), generate the JCL you need, then submit that job via the internal reader.

Re: substitute into JCL varying by job

PostPosted: Thu Sep 01, 2016 12:31 am
by KGherlone
Generating the JCL programmatically and submitting via the internal reader was one approach considered. The preference, of course, is to just have a PROC that has a variable that could be populated by a program and picked up in the JCL as a substitution. If there is not a way to do this, then the internal reader approach, unfortunately, will have to be used.

Re: substitute into JCL varying by job

PostPosted: Thu Sep 01, 2016 12:38 am
by Robert Sample
What release of z/OS are you running? With recent releases (2.1 and 2.2), you have the option to use SET (i.e., JCL symbolic) variables with in-stream data. If you're not running a version of z/OS that supports in-stream variable substitution, then you have to create a job to be submitted to the internal reader as otherwise your HRECALL won't work.

Re: substitute into JCL varying by job

PostPosted: Thu Sep 01, 2016 12:46 am
by KGherlone
We are running z/OS 2.1. I don't see how using a SET statement would do the trick in this case, though. The value for the variable would, ideally, be set in a program and then that variable used as a substitution in the PROC.

Re: substitute into JCL varying by job

PostPosted: Thu Sep 01, 2016 1:01 am
by Akatsukami
In that case, can you submit a job that runs a Rexx exec that reads the data set and tailors a JCL skeleton? (You could also write a program in another language, although that would be a little more effort.)

Re: substitute into JCL varying by job

PostPosted: Thu Sep 01, 2016 1:14 am
by KGherlone
The shop standard here is to not use REXX for production jobs (don't ask...), so the preference is to read the file with the terminated user id into COBOL program, set a variable there (similar to what a ISPF panel would do) then use the variable in the JCL.
It sounds so easy, yet is proving to be so painful...

Re: substitute into JCL varying by job

PostPosted: Thu Sep 01, 2016 1:20 am
by Akatsukami
I haven't written COBOL in this century(although I suppose the practice would be good for me). Does your shop use PL/I or C/370?