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

Transform rows to columns


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kvamsy

New User


Joined: 14 Apr 2009
Posts: 10
Location: chennai

PostPosted: Mon Mar 18, 2013 6:36 pm
Reply with quote

Hi,

Is there any way to convert from Rows to columns as given below

Input
Code:
Group
301     RDDD
302     ETH
305     RDDD
306     RDDD
307     RDDD
310     RDDD


Output

301302305306307310 until 20 groups in one column.... I know it can be done using cobol arrays concept, i want know if this can be possible using DFsort or icetool. If yes, Please let me know..

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 18, 2013 6:41 pm
Reply with quote

Have a look at ICETOOL's RESIZE operator. Search the forum for examples, the manual, google.

Is that your entire file, or is there other data as well?
Back to top
View user's profile Send private message
kvamsy

New User


Joined: 14 Apr 2009
Posts: 10
Location: chennai

PostPosted: Mon Mar 18, 2013 6:43 pm
Reply with quote

Bill Woodger wrote:
Have a look at ICETOOL's RESIZE operator. Search the forum for examples, the manual, google.

Is that your entire file, or is there other data as well?


Just an example, but i have group from 3 - 5 and RDDD starts from 75 position.

file consists of 1800 rows.. I want only 20 groups in each column.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 18, 2013 7:15 pm
Reply with quote

This would seem to do what you ask for....

Code:
//MAKELNG EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//OUT1 DD SYSOUT=*
//TOOLIN DD *
  RESIZE FROM(IN1) TO(OUT1) TOLEN(60) USING(CTL1)
//CTL1CNTL DD *
  OPTION COPY
  OMIT COND=(1,6,CH,EQ,C'GROUP ')
  INREC BUILD=(1,3)
//IN1 DD *
GROUP
301     RDDD
302     ETH
305     RDDD
306     RDDD
307     RDDD
310     RDDD


Output is:

Code:
301302305306307310
Back to top
View user's profile Send private message
kvamsy

New User


Joined: 14 Apr 2009
Posts: 10
Location: chennai

PostPosted: Mon Mar 18, 2013 7:33 pm
Reply with quote

Bill Woodger wrote:
This would seem to do what you ask for....

Code:
//MAKELNG EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//OUT1 DD SYSOUT=*
//TOOLIN DD *
  RESIZE FROM(IN1) TO(OUT1) TOLEN(60) USING(CTL1)
//CTL1CNTL DD *
  OPTION COPY
  OMIT COND=(1,6,CH,EQ,C'GROUP ')
  INREC BUILD=(1,3)
//IN1 DD *
GROUP
301     RDDD
302     ETH
305     RDDD
306     RDDD
307     RDDD
310     RDDD


Output is:

Code:
301302305306307310


Thanks a lot....
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Increase the number of columns in the... IBM Tools 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top