Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 2237
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: 2237
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: 2237
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 To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us