Link to home
Start Free TrialLog in
Avatar of bhagatali
bhagataliFlag for United States of America

asked on

Basic question on Override files?

Hi,

I have a very basic COBOL program which reads from a file SCRIPT. The file SCRIPT has 2 versions, VERSION001 and VERSION002. From a CL program, to achieve processing the 2 versions in parallel I need to do the following:

1) Override VERSION001 of SCRIPT.
2) Do a SBMJOB to call the COBOL program (expecting to read values from VERSION001).
3) Override VERSION002 of SCRIPT.
4) Do a SBMJOB to call the COBOL program (expecting to read values from VERSION002).

I thought this was pretty basic stuff and should be a piece of cake. However, when I execute my CL program, both the instances of COBOL that I am running read from the default VERSION001.

Any pointers on what I am doing wrong?

Here is the OVRDBF command that I am using:

OVRDBF     FILE(SCRIPT) TOFILE(SCRIPT) +          
                   MBR(VERSION001) OVRSCOPE(*JOB) +            
                   SHARE(*YES) OPNSCOPE(*JOB)                  
                                                         
SBMJOB     CMD(CALL PGM(TESTING)) JOB(TEST_OVR1)  
                                                         
DLTOVR     FILE(*ALL) LVL(*JOB)                          
                                                         
OVRDBF     FILE(SCRIPT) TOFILE(RKUMAR/SCRIPT) +          
                   MBR(VERSION002) OVRSCOPE(*JOB) +            
                   SHARE(*YES) OPNSCOPE(*JOB)                  
                                                         
SBMJOB     CMD(CALL PGM(TESTING)) JOB(TEST_OVR2)  

Thanks for any guidance.

Regards
Ali.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_276102
Member_2_276102

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You have your program essentially written just put the code you have above in a single CL program and change the SBMJOB comands to calls.  Then submit this single CL to batch..



PGM       NewCL

OVRDBF     FILE(SCRIPT) TOFILE(SCRIPT) +          
                   MBR(VERSION001) OVRSCOPE(*JOB) +            
                   SHARE(*YES) OPNSCOPE(*JOB)                  
                                                         
CALL PGM(TESTING)
                                                         
DLTOVR     FILE(*ALL)                          
                                                         
OVRDBF     FILE(SCRIPT) TOFILE(RKUMAR/SCRIPT) +          
                   MBR(VERSION002) OVRSCOPE(*JOB) +            
                   SHARE(*YES) OPNSCOPE(*JOB)                  
                                                         
CALL PGM(TESTING)

EndPgm  



Then just  submit the above CL  to batch:


SBMJOB     CMD(CALL PGM(NewCL)) JOB(WhateverName)

I would put a bit of error control in the program but that's about it.