Minoru Massaki,
It is quite simple to get the last 8 bytes from a variable length file
without an exit. You simply need to use JFY to push the contents to the
right and then pick the last 8 bytes and then use another JFY to push the
contents to the left and there by achieving the desired results.
I assumed that your Input VB file has an LRECL=80. You can adjust the
length if your input file has a different length.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,Your Input VB 80 byte file.
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,04, $ RDW
5,76,JFY=(SHIFT=RIGHT))), $ SHIFT DATA TO RIGHT
IFTHEN=(WHEN=INIT,
BUILD=(01,04, $ RDW
73,08, $ LAST 8 BYTES
05,76,JFY=(SHIFT=LEFT))) $ SHIFT DATA TO LEFT
OUTFIL VLTRIM=C' ' $ REMOVE TRAIL SPACES
//*
Sri Hari Kolusu
DFSORT Development
IBM Corporation
IBM Mainframe Discussion List <[email protected]> wrote on
06/07/2015 06:28:01 AM:
> From: Minoru Massaki <[email protected]>
> To: [email protected]
> Date: 06/07/2015 06:28 AM
> Subject: DFSORT - How to select last 8 bytes in variable length records
> Sent by: IBM Mainframe Discussion List <[email protected]>
>
> Hello
>
> There is a input file of variable length records.
> I want to insert the last 8 bytes of a record to front of the record as
> following sample.
>
> Input file:
> RECORD01X11AAAAAAAA
> RECORD02Y2BBBBBBBB
> RECORD03ZCCCCCCC
> RECORD044A4444444DDDDDDDD
> RECORD0555B55555555EEEEEEEE
>
> Output File I want to have:
> AAAAAAAA RECORD01X11AAAAAAAA
> BBBBBBBB RECORD02Y2BBBBBBBB
> ZCCCCCCC RECORD03ZCCCCCCC
> DDDDDDDD RECORD044A4444444DDDDDDDD
> EEEEEEEE RECORD0555B55555555EEEEEEEE
>
> Record data before the last 8 bytes may contain x'00' thru x'FF',
> there is no specific delimiter character for parsing the last 8 bytes.
> The last 8 bytes is also binary.
>
> I'd like to hear any ideas how this to be done by DFSORT WITHOUT using
> E15/E35.
>
> Your help would be highly appreciated.
>
> Minoru Massaki - M*M
>
>
>
>
>
>
> --
>
> 全先 実 - Minoru Massaki (M*M)
> E-mail: [email protected]
>
> ----------------------------------------------------------------------
> 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