Matches keyword write the

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
deva_048
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Skillset: JCL, COBOL
Referer: peterh

Matches keyword write the

Postby deva_048 » Wed Oct 15, 2014 5:48 pm

Is it possbile to extract output file as mentioned below: I already tried group but can't able to get the exact output. Please help me
i/P File:

Code: Select all

AAAA001|2014|ABEND       |10/15|05:00|05:10
AAAA001|2014|COMPLETE    |10/15|05:40|05:50
AAAA002|2014|ABEND       |10/15|06:00|06:10
AAAA002|2014|PURGED      |10/15|06:40|06:50
AAAA003|2014|COMPLETE    |10/15|07:00|07:10



O/P File:

Code: Select all

AAAA001|2014|COMPLETE    |10/15|05:00|05:50
AAAA002|2014|PURGED      |10/15|06:00|06:50
AAAA003|2014|COMPLETE    |10/15|07:00|07:10

Thampy
Posts: 36
Joined: Sat Sep 26, 2009 2:27 pm
Skillset: Cobol,Jcl,Vsam,Db2,Ideal,Datacom
Referer: My colleagues informed about this forum

Re: Matches keyword write the

Postby Thampy » Wed Oct 15, 2014 9:13 pm

I assume that are you are looking for the last occurrence of the group (Positions 1-7)

Code: Select all

//STEP010  EXEC  PGM=SORT                             
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
AAAA001|2014|ABEND       |10/15|05:00|05:10           
AAAA001|2014|COMPLETE    |10/15|05:40|05:50           
AAAA002|2014|ABEND       |10/15|06:00|06:10           
AAAA002|2014|PURGED      |10/15|06:40|06:50           
AAAA003|2014|COMPLETE    |10/15|07:00|07:10           
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
 SORT FIELDS=COPY                                     
 OUTFIL REMOVECC,NODETAIL,SECTIONS=(1,7,               
 TRAILER3=(1,80))                                     
/*                           

If the key is not sorted, then use SORT FIELDS=(1,7,CH,A)

BillyBoyo
Global moderator
Posts: 3805
Joined: Tue Jan 25, 2011 12:02 am
Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
Referer: Google

Re: Matches keyword write the

Postby BillyBoyo » Wed Oct 15, 2014 9:19 pm

I think what you want is just an INCLUDE FIELDS=(....

deva_048
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Skillset: JCL, COBOL
Referer: peterh

Re: Matches keyword write the

Postby deva_048 » Wed Oct 15, 2014 9:23 pm

I am looking for the time fields start time from the abend row and end time from the purge row for each job should be write into a new file

Thampy
Posts: 36
Joined: Sat Sep 26, 2009 2:27 pm
Skillset: Cobol,Jcl,Vsam,Db2,Ideal,Datacom
Referer: My colleagues informed about this forum

Re: Matches keyword write the

Postby Thampy » Thu Oct 16, 2014 6:20 pm

Please try the below JCL.

Code: Select all

//SYSIN    DD *                                                       
 SORT FIELDS=(1,7,CH,A,81,4,ZD,D)                                     
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,4,ZD,RESTART=(1,7))),     
       IFTHEN=(WHEN=GROUP,BEGIN=(81,4,ZD,EQ,1),PUSH=(85:33,5))       
 OUTREC OVERLAY=(81:SEQNUM,4,ZD,RESTART=(1,7),33:85,5)               
 OUTFIL INCLUDE=(81,4,ZD,EQ,1),BUILD=(1,80)                           
/*


The output is coming as

AAAA001|2014|COMPLETE |10/15|05:00|05:50
AAAA002|2014|PURGED |10/15|06:00|06:50
AAAA003|2014|COMPLETE |10/15|07:00|07:10

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

Re: Matches keyword write the

Postby NicC » Fri Oct 17, 2014 12:48 am

Thampy

Those are mainly sort control cards - not JCL.

One day we might get people to use the correct words at the correct time!
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

Terry Heinze
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Skillset: COBOL, JCL, ISPF.
Referer: While searching the Internet for answers.
Location: Richfield, MN, USA

Re: Matches keyword write the

Postby Terry Heinze » Fri Oct 17, 2014 1:41 am

One day we might get people to use the correct words at the correct time!

Don't hold your breath, NicC. :)
.... Terry

Thampy
Posts: 36
Joined: Sat Sep 26, 2009 2:27 pm
Skillset: Cobol,Jcl,Vsam,Db2,Ideal,Datacom
Referer: My colleagues informed about this forum

Re: Matches keyword write the

Postby Thampy » Fri Oct 17, 2014 1:53 am

My apologies. I wrongly mentioned the sort control cards as JCL.

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

Re: Matches keyword write the

Postby NicC » Sat Oct 18, 2014 3:00 am

:lol: :lol:
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

deva_048
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Skillset: JCL, COBOL
Referer: peterh

Re: Matches keyword write the

Postby deva_048 » Fri Oct 24, 2014 9:10 am

Thanks for your timely response. Above code worked perfectly. There is a minor change in our requirement. The complete/purged status will always in first row of each job in the i/p file.
Is it possible to get the below o/p file?

i/p file

Code: Select all

AAAA001|2014|COMPLETE    |10/15|05:40|05:50
AAAA001|2014|ABEND       |10/15|05:20|05:30
AAAA001|2014|ABEND       |10/15|05:00|05:10
AAAA002|2014|PURGED      |10/15|06:40|06:50
AAAA002|2014|ABEND       |10/15|06:10|06:20
AAAA003|2014|COMPLETE    |10/15|07:00|07:10


o/p File

Code: Select all

AAAA001|2014|COMPLETE    |10/15|05:00|05:50
AAAA002|2014|PURGED      |10/15|06:10|06:50
AAAA003|2014|COMPLETE    |10/15|07:00|07:10


  • Similar Topics
    Replies
    Views
    Last post