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
 

 

converts column to rows

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Mon Feb 01, 2010 2:24 pm    Post subject: converts column to rows
Reply with quote

HI can we covert column to rows using Sort ?

Eg :

111 2222
333 4444
555 6666

needs to converted to
111 2222 333 4444 555 6666
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Mon Feb 01, 2010 3:14 pm    Post subject:
Reply with quote

Hello There,

Please refer to below post

http://www.ibmmainframes.com/viewtopic.php?t=37038&highlight=convert+columns
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Feb 01, 2010 11:17 pm    Post subject:
Reply with quote

cvishu,

You haven't given enough information. You need to explain the rules you want to use for converting columns to rows. Do you want to convert everything to ONE row as shown in your example? Or some other variation? How many rows can you have - how many columns - how big can the output row be? What is the RECFM and LRECL of the input file and expected output file? What is the starting position, length and format of each relevant field?
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed Feb 03, 2010 6:51 pm    Post subject:
Reply with quote

Lets say , my input is going to be of 80 bytes and o/p can go as fas as the
row size is needed.

Only single row for o/p , so my entire column in the input will be displayed in onle single row in the output.


Also could you please suggest any alternative for SPLICE option , i am not sure its supported in my office environment

Thnks to both of you for ur response icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 03, 2010 9:05 pm    Post subject:
Reply with quote

Hello,

Quote:
and o/p can go as fas as the row size is needed.
No, it can't. . .

Everything has a limit. . .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Feb 05, 2010 11:12 pm    Post subject:
Reply with quote

Quote:
Also could you please suggest any alternative for SPLICE option , i am not sure its supported in my office environment


Unlikely. SPLICE has been available with DFSORT since Feb, 2003!

Quote:
Only single row for o/p , so my entire column in the input will be displayed in onle single row in the output.


Too vague to answer. If you can't give a better description of what you want to do, then I can't help you.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Tue Feb 09, 2010 8:25 pm    Post subject:
Reply with quote

dick scherrer wrote:
Hello,

Quote:
and o/p can go as fas as the row size is needed.
No, it can't. . .

Everything has a limit. . .



ok my input is going to have 30 columsn and the size of each colum is 10 byts so i need a output with record length 300 byts
Back to top
View user's profile Send private message
Lijo

New User


Joined: 24 Aug 2008
Posts: 41
Location: Cochin

PostPosted: Tue Feb 09, 2010 10:13 pm    Post subject: Reply to: converts column to rows
Reply with quote

Hello,

Quote:
ok my input is going to have 30 columsn and the size of each colum is 10 byts so i need a output with record length 300 byts


Doesn't this mean i/p is of 300bytes???
So, your output will be 300bytes*no of rows in i/p???

I wonder how a project can have such strange requirement icon_rolleyes.gif
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed Feb 10, 2010 10:25 am    Post subject: Re: Reply to: converts column to rows
Reply with quote

Quote:
ok my input is going to have 30 columsn and the size of each colum is 10 byts so i need a output with record length 300 byts


OOPS !! My bad !! icon_sad.gif

its actally 30 rorws in input the length of each row is 10 bytes , so output is
10*30 =>300 byts

eg:
aaaaaaaaaa
bbbbbbbbbb
.
.
.
zzzzzzzzzzz

Hope am clear now.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Feb 10, 2010 10:13 pm    Post subject: Reply to: converts column to rows
Reply with quote

cvishu,

Check out the smart DFSORT trick "Combine multiple records into one record" here. It shows combining 3 records into one , you can use that as a model to map 30 records

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Fri Feb 12, 2010 12:51 pm    Post subject:
Reply with quote

Skolusu

Thank you
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Nov 05, 2010 2:36 am    Post subject:
Reply with quote

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to do this quite easily like this:

Code:

//S1    EXEC  PGM=ICETOOL                         
//TOOLMSG DD SYSOUT=*                             
//DFSMSG  DD SYSOUT=*                             
//IN DD DSN=...  input file (FB/10)
//OUT DD DSN=...  output file (FB/300)                           
//TOOLIN DD *                                     
RESIZE FROM(IN) TO(OUT) TOLEN(300)               


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
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
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


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