Sort help request

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
Srini1808
Posts: 8
Joined: Thu Sep 25, 2014 11:05 am
Skillset: Cobol, jcl, sort, db2, cics
Referer: Internet

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

Code: Select all

Aaaaaaaaaaaaaaaaaaaa
Bbbbbbbbbbbbbbbbbbb
CccccccccccccccccccccDddddddddddddddddddd
Eeeeeeeeeeeeeeeeeeee

Output

Code: Select all

 
Aaaaaaaaaaaaaaaaaaaa
Bbbbbbbbbbbbbbbbbbb
Ccccccccccccccccccccc
Ddddddddddddddddddd
Eeeeeeeeeeeeeeeeeeee


Code'd

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

Srini1808
Posts: 8
Joined: Thu Sep 25, 2014 11:05 am
Skillset: Cobol, jcl, sort, db2, cics
Referer: Internet

Re: Sort help request

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

Thank You very much! Worked perfectly!


  • Similar Topics
    Replies
    Views
    Last post