Minnoru Massaki,

You just threw in a monkey wrench with a data ending with x'40' which is a 
space.  JFY will remove Leading/Trailing blanks. So all the records that 
has x'40' in the last byte will be lost. We need to protect it. Do you 
also happen to have records with leading Space? If so we need to protect 
that too.

One way is to use FINDREP and replace the x'0000000000000040' to a special 
character such as ''@@@@'  and then perform the JFY and then revert it 
back later again with another FINDREP. If your data already has special 
characters then it would get tricky. 

What is the LRECL of the input file? Is it okay to replace the data with @ 
and revert it back?

Thanks, 
Sri Hari Kolusu
DFSORT Development
IBM Corporation

IBM Mainframe Discussion List <[email protected]> wrote on 
06/08/2015 01:14:33 AM:

> From: Minoru Massaki <[email protected]>
> To: [email protected]
> Date: 06/08/2015 01:14 AM
> Subject: Re: DFSORT - How to select last 8 bytes in variable length 
records
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> 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 <[email protected]>:
> 
> > 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
> >
> 
> 
> 
> -- 
> 
> 全先 実  -  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

Reply via email to