bhagatali
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.