Sort help request



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

Sort help request

Postby Srini1808 » Sat Sep 27, 2014 9:43 pm

Greetings!
I have a file which is 40 bytes fixed block. Most if the records contain first 20 bytes only. There are a few records which have full 40 bytes. I am trying to write out a file with 20 bytes record size, as shown. If the input file has 4 records, you can see that we will have 5 records in the output. I tried to use sort inRec with IFTHEN logic By checking byte 1 and byte 21 for non blank it did not work. I tried HIT NEXT, it too would not create 2 records Reading a single record. Any help in making me think in the right direction is highly appreciated. Thanks - sreeni
Input
Aaaaaaaaaaaaaaaaaaaa
Bbbbbbbbbbbbbbbbbbb
CccccccccccccccccccccDddddddddddddddddddd
Eeeeeeeeeeeeeeeeeeee

Output
 
Aaaaaaaaaaaaaaaaaaaa
Bbbbbbbbbbbbbbbbbbb
Ccccccccccccccccccccc
Ddddddddddddddddddd
Eeeeeeeeeeeeeeeeeeee


Code'd
Srini1808
 
Posts: 8
Joined: Thu Sep 25, 2014 11:05 am
Has thanked: 2 times
Been thanked: 0 time

Re: Sort help request

Postby BillyBoyo » Sun Sep 28, 2014 3:31 am

Please use the Code tags to preseve spacing when posting.

If you need multiple (two or more) records from an input record, you have to use OUTFIL's slash operator (/), which is available on BUILD.

So you need OUTFIL with IFTHEN=(WHEN=(logical expression) for the record you want to split, then BUILD=(1,20,/,21,20) or similar.

These users thanked the author BillyBoyo for the post:
Srini1808 (Sun Sep 28, 2014 7:26 am)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sort help request

Postby Srini1808 » Sun Sep 28, 2014 7:27 am

Thank You very much! Worked perfectly!
Srini1808
 
Posts: 8
Joined: Thu Sep 25, 2014 11:05 am
Has thanked: 2 times
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post