Page 1 of 2

Reformat input file

PostPosted: Tue May 21, 2013 8:15 pm
by deva_048
Hi ,

I have extracted the two job information in one input dataset. Below information contains the input

00.29.28 JOB45648 ---- TUESDAY,   21 MAY 2013 ---- 
00.29.29 JOB45648  IEF403I AAA10000 - STARTED       
00.30.29 JOB45648  IEF404I AAA10000 - ENDED         
00.41.24 JOB45749 ---- TUESDAY,   21 MAY 2013 ---- 
00.41.24 JOB45749  IEF403I BBB20000 - STARTED       
00.41.43 JOB45749  IEF404I BBB20000 - ENDED


Output file should looks like

Job information
Job Name        Date            START Time   End Time
AAA10000 21 MAY 2013       00.29.29        00.30.29
BBB20000  21 MAY 2013       00.41.24        00.41.43


My syncsort version is
SYNCSORT FOR Z/OS 1.3.2.1R

Please help me to proceed further.

Re: Reformat input file

PostPosted: Tue May 21, 2013 8:45 pm
by steve-myers
  1. Your input appears to be JESMSGLG data. How do you propose to send this data to Syncsort?
  2. I would suggest SMF data would be a more appropriate data source. SMF type 30, subtype 5 records would be the best source, though I cannot imagine how you can persuade Syncsort to analyze them.

Re: Reformat input file

PostPosted: Tue May 21, 2013 8:51 pm
by deva_048
Yes, I have extracted JESMSGLG information into ps file. The PS file should be reformat like above output and to be written in new dataset.

Re: Reformat input file

PostPosted: Tue May 21, 2013 9:08 pm
by Akatsukami
Would you not be better off writing a COBOL program rather than trawling for Syncsort control cards? :roll:

Re: Reformat input file

PostPosted: Wed May 22, 2013 1:27 am
by NicC
What was wrong with posting in the Sycsort forum? Moved.

Re: Reformat input file

PostPosted: Wed May 22, 2013 4:52 am
by BillyBoyo
00.29.28 JOB45648 ---- TUESDAY, 21 MAY 2013 ----
00.29.29 JOB45648 IEF403I AAA10000 - STARTED
00.30.29 JOB45648 IEF404I AAA10000 - ENDED
00.41.24 JOB45749 ---- TUESDAY, 21 MAY 2013 ----
00.41.24 JOB45749 IEF403I BBB20000 - STARTED
00.41.43 JOB45749 IEF404I BBB20000 - ENDED

You're going to need:

 OPTION COPY
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(start,4,CH,EQ,C'----'),PUSH=(134:startofdate,lengthofdate)),
      IFTHEN=(WHEN=GROUP,BEGIN=(start,7,CH,EQ,C'STARTED'),PUSH=(150:1,8))


This will get your third record of the "group" of three for a JOB containing all the information you need. The date will appear at position 134 on all the three records, the start time on the second and third record. You then include only the record with ENDED, and just rearrange your information to what you want.

You'll then need:

  OUTFIL REMOVECC,HEADER1=(C'your first header',/,
                          C'your second header'),
         INCLUDE=(start,5,CH,EQ,C'ENDED'),
         BUILD=(your data in the order that you want it)


That should get you started.

Re: Reformat input file

PostPosted: Wed May 22, 2013 7:18 am
by deva_048
Thanks a lot Billy. Let me have a try and let you know soon...

I am not sure the above sort card contains only the start,end and date information. The job name not included in the sort card. Please correct me if i am wrong.

Re: Reformat input file

PostPosted: Wed May 22, 2013 7:21 am
by deva_048
Hi Akatsukami

Please let me know the idea or logic to implement the same in cobol just draft logic.

Thanks in advance.

Re: Reformat input file

PostPosted: Wed May 22, 2013 11:47 am
by BillyBoyo
The Job name is on both the STARTED and ENDED records.

Re: Reformat input file

PostPosted: Wed May 22, 2013 7:43 pm
by deva_048
Thanks it works for me...