View previous topic :: View next topic
|
Author |
Message |
karthik3883
New User
Joined: 19 Oct 2007 Posts: 37 Location: chennai
|
|
|
|
Hi,
Suppose i have a variable length file from 50 to 100 record size lenght and suppose i have inserted a record with 60 size and what will be the remaining 40 ,will it be filled up with empty spaces....
suppose if i want to use the 40 space again will it be possible
regards
Karthik |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
Quote: |
Suppose i have a variable length file from 50 to 100 record size lenght |
Ok.
Quote: |
suppose i have inserted a record with 60 size and what will be the remaining 40 ,will it be filled up with empty spaces.... |
If the output record was initialized before write process ,it will have SPACES in the remaining 40.
Quote: |
suppose if i want to use the 40 space again will it be possible |
It is possible by opening the file in I-O mode and reading the record in which you want to write data which has 40 spaces by some programming logic and write the desired content. |
|
Back to top |
|
|
karthik3883
New User
Joined: 19 Oct 2007 Posts: 37 Location: chennai
|
|
|
|
hi muthu
thanks for the reply i have one query wat it will be if we doesnt initialize the output record,will it still contains the spaces.
Regards
Karthik |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
Quote: |
wat it will be if we doesnt initialize the output record,will it still contains the spaces. |
It depends.It can have spaces,low/high values or the data of the previous record.
Initialize is must in order to maintain data integrity |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
We better reach an agreement on the meaning of variable record...
from a data management point of view every record is prefixed with a four byte field
which in the first half contains the record length, called usually RDW ( record definition word )
the input area will contain only the data which is actually there,
the remainder of the buffer will contain garbage from the previous read
it the responsibility of the program to process for each record read only the relevant data
for PS ( Physical Sequentia )l datasets changing the record lenght ( adding or subtracting fields )
is not a problem ( you will only write to an output dataset )
for VSAM KSDS data managent takes care of all the buffer shifting and CI splits
in order to accommodate for inplace changes to the record length
as long the write statement takes care of telling the new lebth |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Quote: |
suppose i have inserted a record with 60 size and what will be the remaining 40 ,will it be filled up with empty spaces.... |
If the output record was initialized before write process ,it will have SPACES in the remaining 40. |
If the record was truly 60 bytes, there will be no remaining 40 (and nothing can be initialized to any value for those positoins). Variable means the length will change depending on the size of the record that was written. |
|
Back to top |
|
|
|