Page 1 of 1

Sort - unwanted data

PostPosted: Tue Jun 21, 2011 3:11 am
by Kitz
I'm reading a file using SORT which is in the format FBA and LRECL=133 and, then writing to an output file of the format FB and LRECL=80. I am using INREC FIELDS=(1:2,5,8:8,8,18:94,9,28:115,5) along with the SORT.

The output is actually 32 length (though LRECL is 80) but the rest of the field is unwanted data. Please advise how to get rid of this data?

Please help.

Thanks & Regards,
Kitz

Re: Sort - unwanted data

PostPosted: Tue Jun 21, 2011 4:10 am
by Frank Yaeger
Kitz,

I can't tell from your explanation if you want the output LRECL to be 32 or 80. Which is it?

If you want the output data set to have RECFM=FB, the you must specify RECFM=FB on the output DD. Otherwise DFSORT will use the input RECFM of FBA.

If you want your output data set to have LRECL=32, then use this INREC statement and ensure that your output data set has LRECL=32 (or no LRECL) and RECFM=FB.

    OPTION COPY
    INREC FIELDS=(1:2,5,8:8,8,18:94,9,28:115,5) 


If you want LRECL=80 for your output data set, then use this INREC statement and ensure that your output data set has LRECL=80 (or no LRECL) and RECFM=FB.

    OPTION COPY
    INREC FIELDS=(1:2,5,8:8,8,18:94,9,28:115,5,80:X) 


You need to have the reformatted length set up by the INREC statement MATCH the LRECL of the output file.

If you're still having problems, show the complete JES log for your run.

Re: Sort - unwanted data

PostPosted: Tue Jun 21, 2011 1:49 pm
by Kitz
Thanks a lot Frank. I need LRECL=80 and RECFM=FB for my output dataset:
It worked with your below code:

  OPTION COPY
  INREC FIELDS=(1:2,5,8:8,8,18:94,9,28:115,5,80:X)


Thanks again.

Regards,
Kitz