Page 1 of 1

Obtain the first columns

PostPosted: Fri Aug 05, 2011 1:57 pm
by samb01
Hello,


i would like getting the 25 th first columns of a sortin data.

My sortout data is already existing and his LRECL is 117 (FB format).

The BIND doesn't work because my SORTOUT DATA has not a 25 LRECL...

Thanks for you help.

Re: Obtain the first columns

PostPosted: Fri Aug 05, 2011 2:26 pm
by NicC
I do not really understand what you are saying/asking or trying to do. Columns are DB2 things - sort uses fields. What BIND does not work? You do not bind when sorting. Is this a sort or DB2 question?

Re: Obtain the first columns

PostPosted: Fri Aug 05, 2011 5:24 pm
by samb01
This is the sysin of the program SORT


//SYSIN DD *                         
  SORT FIELDS=COPY                     
  OUTFIL FNAMES=SORTOUT,BUILD=(1,50)   




Sorry, it's not BIND but BUILD :oops:

It doesn't work because the sortout dataset has an LRECL too long...

Re: Obtain the first columns

PostPosted: Fri Aug 05, 2011 8:53 pm
by NicC
what is wrong with just creating a new dataset? And omit the DCB values - DFSORT will handle those.

Re: Obtain the first columns

PostPosted: Fri Aug 05, 2011 10:52 pm
by Frank Yaeger
samb01,

The SORTOUT LRECL must MATCH the reformatted BUILD length. If you want output LRECL=117, you must pad the reformatted records to 117 bytes, e.g. to pad with blanks use:

   OUTFIL FNAMES=SORTOUT,BUILD=(1,50,117:X)   


i would like getting the 25 th first columns of a sortin data.


Then why are you using 50 instead of 25?

Re: Obtain the first columns

PostPosted: Fri Aug 05, 2011 10:54 pm
by Frank Yaeger
what is wrong with just creating a new dataset? And omit the DCB values - DFSORT will handle those.


That will work if he wants SORTOUT LRECL=50, but not if he wants SORTOUT LRECL=117.

Re: Obtain the first columns

PostPosted: Tue Aug 09, 2011 1:30 pm
by samb01
Frank Yaeger wrote:samb01,

The SORTOUT LRECL must MATCH the reformatted BUILD length. If you want output LRECL=117, you must pad the reformatted records to 117 bytes, e.g. to pad with blanks use:

   OUTFIL FNAMES=SORTOUT,BUILD=(1,50,117:X)   


i would like getting the 25 th first columns of a sortin data.


Then why are you using 50 instead of 25?


Thanks a lot Frank Yaeger,

it is what i want. The number 25 is a mistake... I want the 50 th fisrt columns.