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.
bhagataliAsked:
Who is Participating?
 
tliottaConnect With a Mentor Commented:
The OVRDBF commands run in the job that does the SBMJOB commands. But the submitted jobs are separate -- they have no overrides.

The OVRDBF commands must run in the same job as the CALL PGM(TESTING) commands.

Create two small CL programs that do the OVRDBF followed by a CALL. Have the first CL override to version #1, and the second CL to override to version #2. Then submit the two CL programs.

The CL will cause those overrides to run in the jobs that call the programs. You can't run an override in one job and have it be effective in a different job. The system would never know which job should be overridden.

Tom
0
 
tmiller2002Commented:
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.





0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.