sivafdms Intermediate
Joined: 29 May 2007 Posts: 165 Topics: 77
|
Posted: Wed May 25, 2016 9:28 am Post subject: Horizontol to Vertical format in Syncsort |
|
|
Hi All,
I want my records to be written in veritical format as shown .
LRECL =110
RECFM =FB
Input
Code: |
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 CW ,2016-05-23, 10
000002 CS ,2016-05-24, 12
000003 GS ,2016-05-23, 3
000004 GS ,2016-05-24, 48
000005 GS ,2016-05-25, 465
000006 FD ,2016-05-23, 10
000007 FD ,2016-05-24, 20
****** **************************** Bottom of Data ****************************
|
Output
Code: |
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 Date ,CW ,CS ,GS ,FD ,
000002 2016-05-23 , 10, 12, 3, 10,
000003 2016-05-24 , 0, 0, 48, 20,
000004 2016-05-25 , 0, 0, 465, 0,
****** **************************** Bottom of Data ****************************
|
Thanks,
Siva |
|
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed May 25, 2016 1:30 pm Post subject: |
|
|
sivafdms,
your desired output does not match the input. For GS you don't have a value for 05-23 date but you show it and for 05-24 you have GS data of 12 but you show zero.
Either way since you are using syncsort, here is an outline
1. Sort the file based on date
2. Use OUTREC IFTHEN to arrange the data based on the indicator
3. Use SECTIONS on date to write a single record. _________________ Kolusu
www.linkedin.com/in/kolusu |
|