I've a flat file which is basically job logs for a given day. I need to develop a tool which takes the jobname as an input & pulls that particular job log from the file.The i/p file looks like..........
Code:
J E S 2 J O B L O G -- S Y S T E M X B O C -- N O D E
16.00.49 JOB06098 IEF196I BOC987I JOB=KEYADATE STP=ZEKECTL RC=NXEQ
16.00.49 JOB06098 IEF196I BOC987I JOB=KEYADATE STP=KEYA010 RC=0000
* STEP ZEKECTL PROGRAM IEFBR14 REGION USED 0K CPU TIME 00:00:00
* STEP KEYA010 PROGRAM KEY0DATE REGION USED 668K CPU TIME 00:00:00
J E S 2 J O B L O G -- S Y S T E M E B O C -- N O D E
13.00.40 JOB55270 IEF196I BOC987I JOB=KEYBDATE STP=ZEKECTL RC=NXEQ
13.00.40 JOB55270 IEF196I BOC987I JOB=KEYBDATE STP=KEYB010 RC=0000
* STEP ZEKECTL PROGRAM IEFBR14 REGION USED 0K CPU TIME 00:00:00
* STEP KEYB010 PROGRAM KEY0DATE REGION USED 664K CPU TIME 00:00:00
J E S 2 J O B L O G -- S Y S T E M E B O C -- N O D E
my o/p file should have
Code:
J E S 2 J O B L O G -- S Y S T E M X B O C -- N O D E
16.00.49 JOB06098 IEF196I BOC987I JOB=KEYADATE STP=ZEKECTL RC=NXEQ
16.00.49 JOB06098 IEF196I BOC987I JOB=KEYADATE STP=KEYA010 RC=0000
* STEP ZEKECTL PROGRAM IEFBR14 REGION USED 0K CPU TIME 00:00:00
* STEP KEYA010 PROGRAM KEY0DATE REGION USED 668K CPU TIME 00:00:00
This job will do what you required. I have assumed both input and output files to be LERCL 90 FB
Code:
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(39,8,CH,EQ,C'KEYADATE'),
END=(1,7,CH,EQ,C'J E S 2'),PUSH=(430:39,8))
OUTFIL BUILD=(1,90),INCLUDE=(430,1,CH,EQ,C'KEYADATE')
your card worked good with a little change in INCLUDE statement,though the JES record appeared in the last.For the time being i moved this record to 1st position in the file manually.
Frank,
I planned to pass the jobname through SYSIN.I dont have any idea about the others ways.Anykind of help regarding this is appreciable.Sorry for the confusion.
Quote:
What is the RECFM and LRECL of your input file?
My input file is fixed block 140 length.
Quote:
Does 'JOB=jobname' always appear in the second record of the group?
Yes 2nd record of every group sud have this string.If a job has five steps then the 1st record will be the JES & 2,3,4,5,6 records will have the 'JOB=jobname' string but with different stepname.
Quote:
Does'JOB=' always start in the same position? If so, what position is that?
yes it starts in 35th position.
please let me know if any other details are required.
This was my post in the forum & thanks all for the help