IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - Converting Columns to rows


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Fri Oct 01, 2010 8:51 am
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
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: 2481
Location: @my desk

PostPosted: Sat Oct 09, 2010 3:19 pm
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
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: 2481
Location: @my desk

PostPosted: Sun Oct 10, 2010 12:53 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top