MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I get disk space saving by using RECFM with VB or V

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
fengling
Beginner


Joined: 09 Jan 2007
Posts: 4
Topics: 2

PostPosted: Wed Nov 14, 2007 5:03 am    Post subject: How can I get disk space saving by using RECFM with VB or V Reply with quote

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.
Back to top
View user's profile Send private message
fengling
Beginner


Joined: 09 Jan 2007
Posts: 4
Topics: 2

PostPosted: Wed Nov 14, 2007 9:08 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Nov 14, 2007 1:41 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group