Hi Kolusu-san and Friemel-san,

Thank you very much for giving nice and elegant solutions.
I really appreciate your helps.

>  The extra space OP showed is just differentiate the output
> but I don't think it is really needed.

Sample output records I show included a blank character between front key
and data.
Actually it is not needed. It is just separater to see key and data easily.


I understood the limitations when I use the DFSORT control statements you
gave.

Again, thank you!!

Minoru Massaki - (M*M)




2015-06-12 0:33 GMT+09:00 Sri h Kolusu <[email protected]>:

> Norbert,
>
> Thanks for the explanation of the control cards but I do understand what
> they are doing. The extra space OP showed is just differentiate the output
> but I don't think it is really needed.
>
> >>The other single pass job needed special/reserved characters not in the
> input data. This job allows all characters in the input data
>  (for lrecl < 16k)
>
> As you pointed out some of the solutions have limitations. In your case it
> is the LRECL limitation and in my case it is the special characters
> limitation. So given the available information, I try to come up with a
> solution and both of us are trying to help.
>
>
> IBM Mainframe Discussion List <[email protected]> wrote on
> 06/10/2015 05:06:50 PM:
>
> > From: Norbert Friemel <[email protected]>
> > To: [email protected]
> > Date: 06/10/2015 05:07 PM
> > Subject: Re: DFSORT - How to select last 8 bytes in variable length
> records
> > Sent by: IBM Mainframe Discussion List <[email protected]>
> >
> > On Wed, 10 Jun 2015 14:57:33 -0700, Sri h Kolusu wrote:
> >
> > >Norbert,
> > >
> > >As I mentioned earlier it can be done in single pass as shown earlier,
> I
> > >was just trying to optimize your Joinkeys job.  With your new job there
> a
> > >couple of issues
> > >
> > >1. I am not sure as to why you need to append C'40' (may be you meant
> > >X'40')
> >  >2. With the append of C'40' your output LRECL is increased by 1.  ie.
> the
> > >output now has LRECL+8+1
> >
> > Quote from the first post in this thread:
> >
> > > 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.
> >
> > The output example shows the last 8 bytes of the input records in
> > col. 1-8 and a space on col. 9. The data from the input record
> > starts at col 10.
> > I create the output record as a HEX string and convert it back in
> > the last step. That's why I append C'40' (it's converted to x'40' in
> > the last BUILD-statement:
> > 1. BUILD=(1,4,5,HEX))
> > converts the input record to hex
> > 2. OVERLAY=(5:hex_data,JFY=(SHIFT=RIGHT)))
> > shifts the hex string (inserts spaces to the left)
> > 3. BUILD=(1,4,key_start,16,C'40',hex_data,JFY=(SHIFT=LEFT)))
> > creates a record with the last 16 bytes of the hex string, a
> > "hexified" space (C'40') and the (hexified) input record shifted to
> > the left (spaces on the right)
> > 4. FINDREP=(IN=(C' '),OUT=C''))
> > removes spaces (x'40' at the end of the record, not c'40' in col. 17/18)
> > 5. BUILD=(1,4,5,TRAN=UNHEX))
> > converts to record to binary
> >
> > The other single pass job needed special/reserved characters not in
> > the input data. This job allows all characters in the input data
> > (for lrecl < 16k)
> >
> > >3. I am not sure as to why you need to validate the RDW to remove the
> > >short records. JFY will pad up short records. So even if you records
> with
> > >lrecl less than 12 it will only pick the available characters.
> >
> > JFY pads the HEX string with spaces (x'40'). I thought that
> > converting this with TRAN=UNHEX adds (unwanted) x'00's to col. 1-8
> > of short records.  But that's not the case - FINDREP removes the
> > leading spaces. So yes, the RDW check could be removed.
> >
> > Norbert Friemel
> >
> > ----------------------------------------------------------------------
> > 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

Reply via email to