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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN