I have been lucky to have been able to find answers to all of my questions without creating a new post until now. Thanks to everyone for the extensive information shared in the forum. I respect you all.
I request your guidance in achieving the below requirement:
1. I need to copy a particular range of records (list of application IDs to which the job belongs to) from the input file (OPC scheduler report)
2. The input file is FBA file of LRECL 122. Here is how the input file looks like.
JOBNAME1 APPL_ID1
APPL_ID2
APPL_ID3
JOBNAME2 APPL_ID1
APPL_ID2
JOBNAME3 APPL_ID1
JOBNAME4 APPL_ID1
APPL_ID2
APPL_ID3
APPL_ID4
APPL_ID5
JOBNAME5 APPL_ID1
JOBNAME6 APPL_ID1
APPL_ID2
JOBNAME7 APPL_ID1
APPL_ID2
.
.
.
.
JOBNAMEn APPL_IDn
APPL_ID2
APPL_ID3
JOBNAME2 APPL_ID1
APPL_ID2
JOBNAME3 APPL_ID1
JOBNAME4 APPL_ID1
APPL_ID2
APPL_ID3
APPL_ID4
APPL_ID5
JOBNAME5 APPL_ID1
JOBNAME6 APPL_ID1
APPL_ID2
JOBNAME7 APPL_ID1
APPL_ID2
.
.
.
.
JOBNAMEn APPL_IDn
3. I have coded the below ICEMAN condition to select the range of records starting from the record having the jobname searched for till the next record containing a job name (non-blank character in the first position of the file --> next set of job name & application IDs)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(2,8,CH,EQ,C'JOBNAME4'),
END=(2,8,CH,NE,C' '),
PUSH=(122:ID=8))
OUTFIL INCLUDE=(122,8,ZD,EQ,1,AND,2,8,CH,EQ,C' ')
/*
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(2,8,CH,EQ,C'JOBNAME4'),
END=(2,8,CH,NE,C' '),
PUSH=(122:ID=8))
OUTFIL INCLUDE=(122,8,ZD,EQ,1,AND,2,8,CH,EQ,C' ')
/*
4. Desired output:
- JOBNAME4 APPL_ID1
APPL_ID2
APPL_ID3
APPL_ID4
APPL_ID5
I am getting a blank output when I run the utility with the above condition. However, I am getting the desired output when I mention the JOBNAME5 in the condition instead of checking for non-blank record, as shown below:
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(2,8,CH,EQ,C'JOBNAME4'),
END=(2,8,CH,EQ,C'JOBNAME5'),
PUSH=(122:ID=8))
OUTFIL INCLUDE=(122,8,ZD,EQ,1,AND,2,8,CH,NE,C'JOBNAME5')
/*
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(2,8,CH,EQ,C'JOBNAME4'),
END=(2,8,CH,EQ,C'JOBNAME5'),
PUSH=(122:ID=8))
OUTFIL INCLUDE=(122,8,ZD,EQ,1,AND,2,8,CH,NE,C'JOBNAME5')
/*
Kindly share your expertise to help me achieve my desired result.
Thanks,
Sivaguru