How to copy the next record of a particular record



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

How to copy the next record of a particular record

Postby ankushgattani » Mon Oct 01, 2012 4:01 pm

Hi,
I am trying to code the following logic:

My input file has following record:
xxxxxx
      yy
zzz
xxxxxx
          yy
zzz

I have to do a FIND for 'xxxxxx', if its found in Nth record, I've to copy the (N+1)th record to the output file.
My Desired record (containg yy) will always occur between xxxxxx and zzz. So these 3 records kind of form a group record.
This complete group record can occur many times in the input file.

My Output file will be :
      yy
          yyy

I tried using
INREC IFTHEN=(WHEN=GROUP,

But my system has syncsort 1.3.0.2R and it doesn't support GROUP statement.
can anyone suggest me another method to achieve this.
ankushgattani
 
Posts: 30
Joined: Wed Aug 29, 2012 12:20 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to copy the next record of a particular record

 

Re: How to copy the next record of a particular record

Postby BillyBoyo » Mon Oct 01, 2012 5:39 pm

Mmmm... any update of SyncSort due in the near future? That's old.

Without WHEN=GROUP, you can't get data from one record onto another record. There is JOINKEYS. Even if you have that, SyncSort as standard doesn't have the JNFnCNTL files, so if there was a JOINKEYS solution it'd be in two or three steps.

Without a later SyncSort, I think your best bet is to write a program.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to copy the next record of a particular record

Postby dick scherrer » Mon Oct 01, 2012 8:24 pm

Hello,

My 1.3 documentation has this:
The IFTHEN parameter has been enhanced to include the WHEN=GROUP
subparameter. The WHEN=GROUP subparameter groups records and propagates
fields, identifiers, and sequence numbers based on the criteria specified in this
subparameter’s options.


fwiw . . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: How to copy the next record of a particular record

Postby BillyBoyo » Mon Oct 01, 2012 8:40 pm

ankushgattani,

Can you therefore show us a simple Sort step with WHEN=GROUP as you coded it so and post the sysout from the step?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post