Hi,

maybe this two ways can solve the problem:

OPTION COPY
 OUTREC PARSE=(%00=(ENDBEFR=C',',FIXLEN=9),
               %01=(ENDBEFR=C',',FIXLEN=7),
               %02=(ENDBEFR=C',',FIXLEN=8),
               %03=(ENDBEFR=C' ',FIXLEN=10)),
  BUILD=(%00,%01,%02,%03,JFY=(SHIFT=RIGHT,LEAD=C'0000000000'),
         15X),CONVERT

or

OPTION COPY
INREC PARSE=(%00=(ENDBEFR=C',',FIXLEN=9),
             %01=(ENDBEFR=C',',FIXLEN=7),
             %02=(ENDBEFR=C',',FIXLEN=8),
             %03=(ENDBEFR=C' ',FIXLEN=10)),
 BUILD=(1,4,%00,%01,%02,%03)
OUTFIL FNAMES=SORTOUT,VTOF,
 OUTREC=(5,9,14,7,21,8,29,10,SFF,EDIT=('TTTTTTTTTT'),15X)

In both case the output if FB 49.

Best regards.
Max


Il giorno mar 12 nov 2019 alle ore 01:09 Farley, Peter x23353 <
[email protected]> ha scritto:

> We currently use SYNCSORT and need to parse an input CSV file with a
> trailing number that we need to right-justify in a fixed-length field with
> leading zeroes instead of leading blanks.
>
> So far I have not been able to find an example that shows how to write out
> that trailing field as a right-justified number with leading zeroes instead
> of leading blanks.
>
> Current SORT control cards look like the below.  Please don't take the
> size of the input fields literally, they can be smaller.  I have just shown
> the example input line with maximum expected input field lengths.
>
> OPTION COPY
> OUTREC PARSE=(%00=(ENDBEFR=C',',FIXLEN=9),
>                %01=(ENDBEFR=C',',FIXLEN=7),
>                %02=(ENDBEFR=C',',FIXLEN=8),
>                %03=(ENDBEFR=C' ',FIXLEN=10)),
>        BUILD=(%00,%01,%02,%03,JFY=(SHIFT=RIGHT),
>               15X),CONVERT
>
> Input file is RECFM=VB,LRECL=259, output file is RECFM=FB,LRECL=49
>
> Sample input line:
>
> ABCDEFGH0,ABCDEF1,20190731,1000
>
> Current output line using above control cards:
>
> ABCDEFGH0ABCDEF120190731      1000
>
> Desired output line (15 trailing blanks):
>
> ABCDEFGH0ABCDEF1201907310000001000
>
> TIA for any advice or RTFM pointer you can provide.
>
> Peter
> --
>
>
>
> This message and any attachments are intended only for the use of the
> addressee and may contain information that is privileged and confidential.
> If the reader of the message is not the intended recipient or an authorized
> representative of the intended recipient, you are hereby notified that any
> dissemination of this communication is strictly prohibited. If you have
> received this communication in error, please notify us immediately by
> e-mail and delete the message and any attachments from your system.
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to