Want to convert this file into varchar format.The first field is of 4 characters which is of fixed length. The 2nd ,3rd ,4th and 5th field are variable fields that can have maximum of 22 characters.
Basically want to add two hexadecimal characters before 2nd,3rd ,4th and 5th field that indicates the length.
Sample output record corresponding to input record number 1 is listed below (used $ character to represent blank and X to represent hexadecimal character)
Thinking of using PARSE first to convert field 2-5 into a fixed string of 22 characters. Then use multiple IF statements to count spaces of individual fields and finally subtract the count from 22.
Is there a better way of achieving this using SORT ?
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Thu Aug 24, 2023 4:31 pm Post subject:
jathampy,
You can use the following DFSORT ICETOOL Jcl which will give you the desired results.
Basically you RESIZE the records after the parse and convert it into VLR so that you can get the length of each record and then re-assemble it back again.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum