Posted: Wed Nov 14, 2007 5:03 am Post subject: How can I get disk space saving by using RECFM with VB or V
Recently, I've been working are VB files, but troubles are coming. How can I get benefit by using VB files instead of FB files.
I guess IBM introduces VB files in order to achieve disk space savings. but I've read some PLI programs and VB files are stilling using in my current project, I got my conclusion that there is no disk space savings using VB files, is that right? Any fellow can give me a point?
Here is my examples:
DCL 1 FREC
,5 PART_A CHAR (10) INIT (' ')
,5 PART_B VARYING CHAR (100) INIT (' ')
,5 PART_C CHAR (100) INIT (' ')
In order to reduce totol bytes, I introduce VARYING CHAR, but when I write this record into FB file, two more control bytes are added to because I used Varying char. if I write this rocord into VB files, the result is that I must allocate 4 more bytes for VB files besides the original record length above.
The result is that I must waste more disk space to save my records, which is not as I expected, if PART_B only contains not more than 10 bytes info, It's a nightmare. can any one get me out, thanks s a lot.
Continued...
I am also wondering whether varying char is saving memory really.....When I write varying char into FB files, the output is that real length indicator(2 bytes) plus max length of varying char(if FB files, the left chars will be initialised by zero); When I write varying char into VB files, the ouput is also real length indicator(2 bytes) plus max length of varying char(if VB files, but the left chars will not be initialise, which is random value). Why there is difference existing?
How do reduce disk space is what I am most concerned about. Using PLI, how can I make my reocords are more smart? Is that doable? field 1 PART_A (10 bytes) field 2 PART_B ( for example, only have 2 bytes('AB'), so the field values is that 2 bytes(2 in binary) plus 'AB', the last one PART_C is just after char 'B'.
If so, Can I use WRITE FILE() FROM (FREC) to make it ? if not, What can I do?
Who can tell me which cases are VB is better than FB files, and easy for programs to read in and write out?
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Wed Nov 14, 2007 1:41 pm Post subject:
The F in FB stands for FIXED LENGTH so making your variable CHAR VARYING will NOT reduce the length of the record - it will stil be 210 bytes long - 10 + 100 + 100
V stands for VARYNG length and allows you to write different records structures wih different lengths to the same file. Understand that and you are part of the way there. _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum