Hi all, I have a SORT problem I can't quite get my head around. I think
I want to use PARSE, but can't figure out if there is an easy way to do
it.
I have an application log file that contains joblogs of thousands of
jobs a day, all with different records. I am interested in only getting
records with a key value of MSG004CI . However, the records have
variable format, and I would like to have SORT not only extract the
records, but also just give me the fields I need. This will be fed into
another reporting program to generate different reports, along with
other operational data. Here are the two basic kinds of formats:
01.34.15 JOB47986 PAYW015A MSG004CI - PROGRAM PARM SCHEDULED:
20221008, RUNTYPE(WEEKLY) ALLSITES 10.4
01.34.15 JOB47986 PAYW052X MSG004CI - PROGRAM PARM REQUEST: 20221012,
RUNTYPE(DAILY) OH03 10.6
Here are my requirements:
1. We will extract if the message is MSG004CI and then I need the
jobname word that comes before that.
2. Next, I need to know how the job was run - either Scheduled or
Request and the date it was run (follows the type). Output is either SCH
or REQ then the date.
3. Then, I want to know what type of run. This can be Daily, Weekly,
Monthly, or Yearly. Output D, W, M, or Y.
4. Next, I need to know the locations processed: This is a variable
length value, ALLSITES is the longest, OH03 is the shortest, with others
of other lengths between.
5. Finally, I need the numeric indicator at the end of the line.
So given the above records, my output would be
PAYW015A SCH 20221008 W ALLSITES 10.4
PAYW052X REQ 20221012 D OH03.... 10.6 <the dots in location should be
spaces to allow me to have a fixed format>
I think I would use Parse to capture these 6 fields, but don't know how
to allow for the different positions they could have. Can you help with
the Inrec definition?
Thank you and best regards,
Billy Ashton
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN