Matches keyword write the



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

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:
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:

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
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

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)

//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)
Thampy
 
Posts: 36
Joined: Sat Sep 26, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 3 times

Re: Matches keyword write the

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

I think what you want is just an INCLUDE FIELDS=(....
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Matches keyword write the

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

Please try the below JCL.
//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

These users thanked the author Thampy for the post:
deva_048 (Fri Oct 24, 2014 8:53 am)
Thampy
 
Posts: 36
Joined: Sat Sep 26, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 3 times

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
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

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.
Thampy
 
Posts: 36
Joined: Sat Sep 26, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 3 times

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
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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
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
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
deva_048
 
Posts: 72
Joined: Thu Feb 02, 2012 9:28 pm
Has thanked: 1 time
Been thanked: 0 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post