Page 2 of 2

Re: Multiple Rows into Single row Multiple columns

PostPosted: Fri Sep 21, 2012 5:29 pm
by BillyBoyo
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.

Re: Multiple Rows into Single row Multiple columns

PostPosted: Fri Sep 21, 2012 9:02 pm
by skolusu
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

Re: Multiple Rows into Single row Multiple columns

PostPosted: Fri Sep 21, 2012 9:11 pm
by BillyBoyo
Or just wait for Kolusu...

Re: Multiple Rows into Single row Multiple columns

PostPosted: Fri Sep 21, 2012 11:10 pm
by ottoelflaco
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 :)

Re: Multiple Rows into Single row Multiple columns

PostPosted: Fri Sep 21, 2012 11:29 pm
by BillyBoyo
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?