Page 1 of 1

Convert VB to FB, pre-pend a value, extend LRECL

PostPosted: Fri Oct 12, 2012 2:33 pm
by NicC
After my usual struggle with the manuals, google, fora searches I am still getting nowhere!

Take a VB file, prepend a static value at the front, write out the record as FB and with a far larger LRECL. My test file is LRECL of 300 (data 296 + 4 RDW) and the longest record is 214 bytes - 218 with RDW. My target LRECL is 500. The value to prepend is 'TAX;' (sans quotes so 4 bytes). I reckon I should have control cards doing something along the lines of:
 OPTION COPY
 OUTFIL BUILD=('TAX;',5,296,500:x),VTOF


Errr, hmmmm.... just tried that combination and it worked! But I will post anyway as it may help someone else (or me when I need to do something similar down the track).

Re: Convert VB to FB, pre-pend a value, extend LRECL

PostPosted: Fri Oct 12, 2012 2:59 pm
by BillyBoyo
Are your variable records all 296 bytes of data (ie a "fixed" file just with an RDW)?

If not, you'll be getting parts of the following record included in your output, and when you exhaust all your buffers you'll have a potential S0C4.

Re: Convert VB to FB, pre-pend a value, extend LRECL

PostPosted: Fri Oct 12, 2012 3:57 pm
by NicC
My longest record is 214 bytes - browsing with hex on there is no padding with spaces to end of record for any record...
Line,00000001 Col 136 215
         Scroll ===> CSR 
Target CVOL %,Target MM %
E8988A4CEDD466E8988A4DD46
319753035630CB3197530440C
-------------------------
                         
                         
                         
-------------------------
                         
                         
                         
-------------------------

My output file looks as expected: my new fixed string at the front, my input data following and padded to 500 bytes with x'40's

Re: Convert VB to FB, pre-pend a value, extend LRECL

PostPosted: Fri Oct 12, 2012 4:37 pm
by BillyBoyo
Yes. After some quick tests this doesn't behave like I saw something with SyncSort "going beyond" the record a while ago. Perhaps this is how it should work, rather than the somewhat tortuous thing I came up with. I think I'll wait for Kolusu... :-)

Re: Convert VB to FB, pre-pend a value, extend LRECL

PostPosted: Fri Oct 12, 2012 9:55 pm
by skolusu
NicC/BillyBoyo,

For DFSORT, by default, VTOF or CONVERT automatically uses VLFILL=X'40' (blank fill byte) to allow processing of variable-length input records which are too short to contain all specified BUILD or OUTREC fields. You can specify VLFILL=byte to change the fill byte.