substitute into JCL varying by job



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

substitute into JCL varying by job

Postby KGherlone » Wed Aug 31, 2016 10:43 pm

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=*
KGherlone
 
Posts: 9
Joined: Wed Aug 31, 2016 10:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: substitute into JCL varying by job

Postby Akatsukami » Wed Aug 31, 2016 11:28 pm

Would making the steps into a proc, substituting the HLQ with a variable, and updating a SET statement manually fulfill your requirement?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: substitute into JCL varying by job

Postby KGherlone » Wed Aug 31, 2016 11:55 pm

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
KGherlone
 
Posts: 9
Joined: Wed Aug 31, 2016 10:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: substitute into JCL varying by job

Postby Robert Sample » Thu Sep 01, 2016 12:25 am

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: substitute into JCL varying by job

Postby KGherlone » Thu Sep 01, 2016 12:31 am

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.
KGherlone
 
Posts: 9
Joined: Wed Aug 31, 2016 10:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: substitute into JCL varying by job

Postby Robert Sample » Thu Sep 01, 2016 12:38 am

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: substitute into JCL varying by job

Postby KGherlone » Thu Sep 01, 2016 12:46 am

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.
KGherlone
 
Posts: 9
Joined: Wed Aug 31, 2016 10:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: substitute into JCL varying by job

Postby Akatsukami » Thu Sep 01, 2016 1:01 am

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.)
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: substitute into JCL varying by job

Postby KGherlone » Thu Sep 01, 2016 1:14 am

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...
KGherlone
 
Posts: 9
Joined: Wed Aug 31, 2016 10:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: substitute into JCL varying by job

Postby Akatsukami » Thu Sep 01, 2016 1:20 am

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?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post