by pinakimishra » Mon Apr 01, 2019 8:24 pm
Below is the Scenario:
I have a File SMD.Static.DATAFILE which has the below data inside it.
Filename , Indicator
ABC.XYZ.TESTJOAB.DATAFILE, Y
DEF.UVW.TESTJOCD.DATAFILE, N
GHI.REW.TESTJOEF.DATAFILE, Y
IJK.BMC.TESTJOGH.DATAFILE, N
LMN.EQY.TESTJOIJ.DATAFILE, N
OPQ.MFD.TESTJOKL.DATAFILE, Y
RST.SBS.TESTJOMN.DATAFILE, Y
I have 6 test jobs, which will have the above SMD.Static.DATAFILE as an i/p as well as one filename as i/p parameter.
If the i/p parameter is present in the file SMD.Static.DATAFILE and Indicator is Y then Return will be 0.
If the i/p parameter is present in the file SMD.Static.DATAFILE and Indicator is N then Return will be 4.
If the i/p parameter is not present in the file SMD.Static.DATAFILE then Return will be 8.
1. TestJob1 - i/p parameter ABC.XYZ.TESTJOAB.DATAFILE - Expected o/p is Return Code 0
2. TestJob2 - i/p parameter DEF.UVW.TESTJOCD.DATAFILE - Expected o/p is Return Code 4
3. TestJob3 - i/p parameter GHI.REW.TESTJOEF.DATAFILE - Expected o/p is Return Code 0
4. TestJob4 - i/p parameter PQR.ABC.TESTJOYZ.DATAFILE - Expected o/p is Return Code 8
5. TestJob5 - i/p parameter IJK.BMC.TESTJOGH.DATAFILE - Expected o/p is Return Code 4
6. TestJob6 - i/p parameter RST.SBS.TESTJOMN.DATAFILE - Expected o/p is Return Code 0
I can do the above with a Cobol program. But Can I do with a Sort?
In Cobol-
Create 6 jobs where create the below parameters as a PARM from the JCL and accept in Cobol program as Linkage section. Pass the SMD.Static.DATAFILE as an i/p filename. Search the parm parameter in the Static file in Cobol program and set the Return Code.
1. TestJob1 - i/p parameter ABC.XYZ.TESTJOAB.DATAFILE
2. TestJob2 - i/p parameter DEF.UVW.TESTJOCD.DATAFILE
3. TestJob3 - i/p parameter GHI.REW.TESTJOEF.DATAFILE
4. TestJob4 - i/p parameter PQR.ABC.TESTJOYZ.DATAFILE
5. TestJob5 - i/p parameter IJK.BMC.TESTJOGH.DATAFILE
6. TestJob6 - i/p parameter RST.SBS.TESTJOMN.DATAFILE