Page 1 of 1

How to copy the next record of a particular record

PostPosted: Mon Oct 01, 2012 4:01 pm
by ankushgattani
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.

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

PostPosted: Mon Oct 01, 2012 5:39 pm
by BillyBoyo
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.

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

PostPosted: Mon Oct 01, 2012 8:24 pm
by dick scherrer
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 . . .

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

PostPosted: Mon Oct 01, 2012 8:40 pm
by BillyBoyo
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?