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
 

 

Transform rows to columns

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Transform rows to columns
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Mar 18, 2013 6:41 pm    Post subject: Reply to: Transform rows to columns
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    Post subject: Re: Reply to: Transform rows to columns
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Mar 18, 2013 7:15 pm    Post subject: Reply to: Transform rows to columns
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    Post subject: Re: Reply to: Transform rows to columns
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
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
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