Page 1 of 1

To add a override statement in JCL

PostPosted: Tue Feb 05, 2019 1:07 pm
by Ashu07
Hi all,
I've a requirement,where I need to add override statement to pick the proc from another library for 3k jobs.Is their any way,where I can say add below statement only before first exec statement in a JCL.

// JCLLIB ORDER=userid.test.proclib

Is there any way/utility we can achieve this.Any inputs will be helpful.

Re: To add a override statement in JCL

PostPosted: Tue Feb 05, 2019 4:49 pm
by NicC
Yes. Refer to similar requirements in the forum.

Re: To add a override statement in JCL

PostPosted: Tue Feb 05, 2019 5:05 pm
by Ashu07
Hi NIck,

I searched the forum with all the possible keywords,couldn't find what I was looking for,that's the reason I posted this question.

Re: To add a override statement in JCL

PostPosted: Tue Feb 05, 2019 7:38 pm
by NicC
The name is Nic or NicC not Nick.
You need to write a program in the language of your choice - probably Rexx - to read each job and insert the new JCLLIB statement. Depending on the EXACT change tobe made it could be done with a simple edit macro.

Re: To add a override statement in JCL

PostPosted: Tue Feb 05, 2019 7:41 pm
by prino
Ashu07 wrote:Hi all,
I've a requirement,where I need to add override statement to pick the proc from another library for 3k jobs.Is their any way,where I can say add below statement only before first exec statement in a JCL.

// JCLLIB ORDER=userid.test.proclib

Is there any way/utility we can achieve this.Any inputs will be helpful.

An override for 3k jobs is insane. Which PHB has decided to do this? Do your auditors agree with it?

Re: To add a override statement in JCL

PostPosted: Tue Feb 05, 2019 8:20 pm
by Ashu07
We are doing this for test environment.so they are fine with it.

Re: To add a override statement in JCL

PostPosted: Tue Feb 05, 2019 9:37 pm
by willy jensen
This is the simplest 'Edit all' command I could find. It doesnt do much in the way of error checking and such, I will leave that up to the user..
/*                                                                 rexx
  Run an ISPF Edit Macro against every member of named pds              
  Syntax:    %Editall dsname edit-macro                                
*/                                                                      
                                                                       
 arg dsn mac                                                            
 zz=outtrap('lst.')                                                    
 "LISTDS" requote(dsn) "MEMBERS"                                        
 zz=outtrap('off')                                                      
                                                                       
 dsn = unquote(dsn)                                                    
 do n = 7 to lst.0                                                      
   Address ISPEXEC "EDIT DATASET('"dsn"("strip(lst.n)")') MACRO("mac")"
 end                                                                    
 exit                                                                  
                                                                       
Requote: if arg(1)='' then return '';else return "'"Unquote(arg(1))"'"  
Unquote: return strip(space(translate(arg(1)," ","'")))                

Sample edit macro
/*  ISPF edit macro          rexx */
 Address Isredit "MACRO NOPROCESS(P)"
 Address Isredit                      
 l='Just testing'                    
 "line_after 1 = (l)"                
 "save"                              
 "cancel"                            

3000 members, it's going to run for a while, so it might be worth your while to look at alternatives like File Manager (dont know if that can do this kind of change). Other consideration, if this is just one PDS and not PDS/E then you could run into space problems.

Re: To add a override statement in JCL

PostPosted: Tue Feb 05, 2019 10:01 pm
by willy jensen
By the way, the sample does not do screen display , so could be run as an ISPF batch job.

Re: To add a override statement in JCL

PostPosted: Wed Feb 06, 2019 1:32 pm
by Ashu07
Thanks Willy,Let me try this out.