Page 1 of 1

Split records into multiple records

PostPosted: Thu May 29, 2014 11:49 am
by zlzlzlzl
Hi All,

I need help in trying to split a single records into multiple records with key.

For example, I have this record P12345AAAABBBBCCCCDDDD, it is a fixed length record.

I would want it to be split into

P12345AAAA1
P12345BBBB2
P12345CCCC3
P12345DDDD4

where A = 1, B = 2, C= 3 and D= 4.

Can this be done using sort or icetool?

Thanks in advance.

Re: Split records into multiple records

PostPosted: Thu May 29, 2014 11:57 am
by BillyBoyo
Yes, if you have an up-to-date DFSORT, ICETOOL has a RESIZE Operator.

If you don't have RESIZE, then use of the slash-operator (/) on OUTFIL will allow you to write multiple records from a single input record.

OUTFIL BUILD=(RECORD-KEY,DATA1,
             /,
              RECORD-KEY,DATA2,
             /,
              RECORD-KEY,DATA3,
             /,
              RECORD-KEY,DATA4)

Re: Split records into multiple records

PostPosted: Thu May 29, 2014 12:13 pm
by zlzlzlzl
Thanks for the reply. The system that I am using do have resize operator.

May I know how do I use this resize function? If possible can you give me an example? Thanks a lot.