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

converts column to rows


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

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

Hello There,

Please refer to below post

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

DFSORT Developer


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

PostPosted: Mon Feb 01, 2010 11:17 pm
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
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

Moderator Emeritus


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

PostPosted: Wed Feb 03, 2010 9:05 pm
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 Developer


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

PostPosted: Fri Feb 05, 2010 11:12 pm
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
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
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
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
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

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
Reply with quote

Skolusu

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

DFSORT Developer


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

PostPosted: Fri Nov 05, 2010 2:36 am
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:

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts To get the count of rows for every 1 ... DB2 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
Search our Forums:

Back to Top