I am trying to select records from a report showing the output of CA-7 LJOB commands. If the job listed is found ("Request Completed", below), I want the 7th line after the command line in the report (or the second line before the "Request Completed"). If not, I want the "NOT FOUND" line. Here is a sample of a report:
18016 110057 LJOB,LIST=AGJOB,JOB=xxxxxxx --> I want the 7th line after this (starting with xxxxxxx, below)
JOB ----JCL---- SYSTEM USR MAIN PROSE
NAME ID MEMBER -NAME- -ID -ID- DSNBR
xxxxxxx nnn xxxxxxx ssssss 000 iii nnnnnn
SLIA-00 REQUEST COMPLETED AT 11:00:57 ON 18.016
18016 110057 LJOB,LIST=AGJOB,JOB=JMKJOB
SLIA-02 JOB=JMKJOB NOT FOUND. --> I want this line.
Commands listing valid jobs and "not found" jobs are interspersed randomly. There is no common value to key off of on the xxxxxxx nnn xxxxxxx ssssss 000 iii nnnnnn lines I need to select.
Can I do this with Syncsort? I can successfully key the output into groups, but I'm not sure what this buys me, if anything. Thanks!
Joined: 10 May 2007 Posts: 2368 Location: Hampshire, UK
That lne looks like the 12th - you have failed to count blank lines which are still lines..
In your input phase try GOUPing and assigning a sequence number and on your output phase selecting only those lines with the sequence number relating to your required line (12).
And plaease use the code tags when posting stuff that requires a fixed pitch font.
Looks like line-13 when counted in notepad. I don't have access to the tool, so really not sure if those blank lines really do exist in the actual data.
Welcome to the forums. As Nic has pointed above, please use Code tags while posting code/data.
Do you need to create 2 outputs - jobs found/jobs not found?
If it is just one output, Nic has already given a hint, use WHEN=GROUP to identify groups BEGINning with 'LJOB' and assign (PUSH) SEQuence numbers to records in each group.
While writing to the output use OUTFIL INCLUDE to
select only records with sequence number = 13
(sequence number =3 AND has 'NOT FOUND')
BEGIN=(1,80,SS,EQ,C' LJOB,LIST='), detect group
PUSH=(81:SEQ=4)) renumber lines within group
OUTFIL INCLUDE=(1,7,CH,EQ,C'SLIA-02', select "not found" line
OR,81,4,CH,EQ,C'0008'), select line #8 after 'group header'