Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Syncsort - Converting Columns to rows

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Wed Sep 29, 2010 7:29 pm    Post subject: Syncsort - Converting Columns to rows
Reply with quote

hi

My Input is

00001 ABCDEFGHIJKL


My required output is

00001 ABCD
00002 EFGH
00003 IJKL

the length of the column is fixed to 4

Please let me know if this is possible using a sort or any utility

Thanks
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2353
Location: @my desk

PostPosted: Fri Oct 01, 2010 8:51 am    Post subject:
Reply with quote

Similar topics have been in discussion sometime back. A search might be of help. BTW Which sort product/version are you having?
Back to top
View user's profile Send private message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Sat Oct 09, 2010 1:03 pm    Post subject: Reply to: Converting Columns to rows
Reply with quote

We have SYNCSORT at our place.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2353
Location: @my desk

PostPosted: Sat Oct 09, 2010 3:19 pm    Post subject:
Reply with quote

Which Syncsort version do you have? Also you have shown only one record in your input. Will that be the case always? If not, then please explain all the rules by which you arrive at the output for a set of input records, not just one.

Mention the starting position, length and format of all relevant fields. Input/output file attributes.
Back to top
View user's profile Send private message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Sat Oct 09, 2010 7:53 pm    Post subject: Reply to: Converting Columns to rows
Reply with quote

Input file:

RECFM=FB, LRECL=85 - it contains only one record.

first 5 bytes are irrelevant, from byte 6, each 4 bytes should come in the next row.

For example:
00001ABCDEFGHIJKLMNOP....

Output:
00001ABCD
00002EFGH
00003IJKL
00004MNOP


For a LRECL= 85 (5 + 20*4)
the output will contain 20 rows. (recfm = fb, LRECL = 80, first 9 bytes with data, and rest 71 bytes as SPACES)

I hope I was able to explain my doubt.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2353
Location: @my desk

PostPosted: Sun Oct 10, 2010 12:53 am    Post subject:
Reply with quote

rakesh1155,

The below Syncsort job should do this for you. This is UNTESTED.
Code:
//STEP01 EXEC PGM=SORT
//SORTIN   DD DSN= Input file  --> FB/LRECL=85
//SORTOUT  DD DSN= Output file --> FB/LRECL=80
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  OUTFIL BUILD=(C'000001',06,4,80:X,/,
                C'000002',10,4,/,
                C'000003',14,4,/,
                C'000004',18,4,/,
                C'000005',22,4,/,
                C'000006',26,4,/,
                C'000007',30,4,/,
                C'000008',34,4,/,
                C'000009',38,4,/,
                C'000010',42,4,/,
                C'000011',46,4,/,
                C'000012',50,4,/,
                C'000013',54,4,/,
                C'000014',58,4,/,
                C'000015',62,4,/,
                C'000016',66,4,/,
                C'000017',70,4,/,
                C'000018',74,4,/,
                C'000019',78,4,/,
                C'000020',82,4)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts help to replace columns by rows Vikas Maharnawar DFSORT/ICETOOL 8 Tue Mar 06, 2018 3:27 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Can we combine the rows with same key... V S Amarendra Reddy DB2 14 Fri Dec 01, 2017 10:29 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us