Hello Kolusu-san,

Thank you very much for giving the answer by using DFSORT.
That is what the customer wants to.

I have additional questions.
If the 8 bytes key is binary data and some records include x'40'  of the
last byte of the key,
 (ex. if the key is binary number 64 --> x'0000000000000040')
Does the shifting to right (JFY=(SHIFT=RIGHT)) work as I expected?

In case of the last and the first byte of the records contain x'40',
what should I modify the DFSORT control statements you gave me.

I really appreciate your kind help.

Minoru Massaki - (M*M)




2015-06-08 14:44 GMT+09:00 Sri h Kolusu <skol...@us.ibm.com>:

> 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 <IBM-MAIN@LISTSERV.UA.EDU> wrote on
> 06/07/2015 06:28:01 AM:
>
> > From: Minoru Massaki <mmass...@gmail.com>
> > To: IBM-MAIN@LISTSERV.UA.EDU
> > 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 <IBM-MAIN@LISTSERV.UA.EDU>
> >
> > 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: mmass...@gmail.com
> >
> > ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



-- 

全先 実  -  Minoru Massaki  (M*M)
E-mail: mmass...@gmail.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to