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



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

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

Postby NicC » Fri Oct 12, 2012 2:33 pm

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).
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2751
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 110 times

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

 

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

Postby BillyBoyo » Fri Oct 12, 2012 2:59 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

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

Postby NicC » Fri Oct 12, 2012 3:57 pm

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
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2751
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 110 times

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

Postby BillyBoyo » Fri Oct 12, 2012 4:37 pm

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... :-)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

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

Postby skolusu » Fri Oct 12, 2012 9:55 pm

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.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

These users thanked the author skolusu for the post:
BillyBoyo (Sat Oct 13, 2012 2:14 am)
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post