Multiple Rows into Single row Multiple columns



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: Multiple Rows into Single row Multiple columns

Postby BillyBoyo » Fri Sep 21, 2012 5:29 pm

But we need to see the ICE201I message to know what level you have. It will be in the sysout of the step I asked you to run.

OK, for learning. Get your manual. If you don't have one, there's one on line (links at top and bottom of this page) and you can use it online or download as, for instance, a PDF.

In the manual, have a look at RESIZE. You might not feel that is what you want, but it is the easiest.

First, just put the three lines into one and show the results.

Then you'll need to get rid of the blanks.

First, do that in a SORT job, with OPTION COPY. Look at SQZ in the manual. You can use INREC with BUILD.

Then we get to doing it in one step.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Multiple Rows into Single row Multiple columns

Postby skolusu » Fri Sep 21, 2012 9:02 pm

ottoelflaco ,

Assuming you want every 3 records(each 10 bytes long) as a single record, the following DFSORT/ICETOOL JCL which will give you the desired results
//STEP0100 EXEC PGM=ICETOOL                     
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN       DD *                                 
CHARLES                                         
1999                                             
SPAIN                                           
//OUT      DD SYSOUT=*                           
//TOOLIN   DD *                                 
  RESIZE FROM(IN) TO(OUT) TOLEN(30) USING(CTL1) 
//*                                             
//CTL1CNTL DD *                                 
  INREC BUILD=(1,10)                             
  OUTFIL BUILD=(1,30,SQZ=(SHIFT=LEFT,MID=C' ')) 
//*


The output is a 30 byte file with the following contents.
CHARLES 1999 SPAIN


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? ... g3T7000242
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Multiple Rows into Single row Multiple columns

Postby BillyBoyo » Fri Sep 21, 2012 9:11 pm

Or just wait for Kolusu...
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Multiple Rows into Single row Multiple columns

Postby ottoelflaco » Fri Sep 21, 2012 11:10 pm

BillyBoyo wrote:Or just wait for Kolusu...

jajaj, thank you billy, i am learning with this comunity :)

skolusu wrote:ottoelflaco ,

Assuming you want every 3 records(each 10 bytes long) as a single record, the following DFSORT/ICETOOL JCL which will give you the desired results
//STEP0100 EXEC PGM=ICETOOL                     
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN       DD *                                 
CHARLES                                         
1999                                             
SPAIN                                           
//OUT      DD SYSOUT=*                           
//TOOLIN   DD *                                 
  RESIZE FROM(IN) TO(OUT) TOLEN(30) USING(CTL1) 
//*                                             
//CTL1CNTL DD *                                 
  INREC BUILD=(1,10)                             
  OUTFIL BUILD=(1,30,SQZ=(SHIFT=LEFT,MID=C' ')) 
//*


The output is a 30 byte file with the following contents.
CHARLES 1999 SPAIN


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? ... g3T7000242


I will try do this when I arrive to home, but that is exactly i wanted.
Thank you both, i continue learning :)
ottoelflaco
 
Posts: 36
Joined: Fri Sep 21, 2012 2:33 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Multiple Rows into Single row Multiple columns

Postby BillyBoyo » Fri Sep 21, 2012 11:29 pm

If you want an additional exercise, how about this

TEXT
1234567890
9876543210


And get that to
TEXT 1234567890 9876543210


Then maybe you can try with the first field all blanks?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post