View previous topic :: View next topic
|
Author |
Message |
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
What will happen if for a field in a Variable Length file , value is missing?
Is it possible to view a VB length file with a copy book, i am not sure here, may be we can; so if we can then will we get missing value for that field? So to avoid such cases do we have something equivalent to Null/Not Null in DB2?
If we don't get missing value in the o/p file then how would the file look like?
Thanks |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Every byte of a file has a value. There is no concept of NULL or missing data in files. NULL applies only to databases, not files. The value of the byte may be a displayable character (such as R or 3) or it may not be displayable (such as x'00') but every byte has a value.
You can view a VB file with a copy book using File Aid or similar tools. If there is a variable number of occurrences for a record, when the record ends there is no more data to see -- the screen is blank and you will not see anything there if you turn HEX ON.
This is very similar to your other question. You need to dump the concept of NULL from your mind when dealing with files -- there is no such thing as NULLs in files (repeat this until you comprehend it). |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
meenakshi_forum wrote: |
What will happen if for a field in a Variable Length file , value is missing? |
Don't touch that file - that's a time bomb, can explode in any program anytime...beware! |
|
Back to top |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
Thanks,
If there is a missing value in the middle of a record then what will happen?
Will the record remain intact?
I am bit confused as in a discussion i came across that the record in the file would shrink, and that raised a doubt that then how it could be viewed using copy book, how we will know the right place of any field value?
Also if the record shrinks then even in 3.4 we will not get proper results.
Please check me, i feel there is something wrong.
One more thing, if there can be displayable /non displayable character for missing value as mentioned above then how come there will not be any such value at the end of the record for a missing value case.
Please correct me if i am going wrong somewhere.
Thanks
Thanks. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
Please correct me if i am going wrong somewhere. |
You are going wrong. A file cannot -- please note carefully CANNOT -- have missing values in the middle of a record. First of all, outside of a database (or a language such as SAS) there is no such thing as a missing value. A file is not a database, it is a file -- so the concept of missing value has no meaning to a file.
I recommend you go back and review the discussion you are referencing. I think you will find the meaning was the bytes were deleted from the middle of the record, not that there was missing data -- because there is no such thing as missing values in a file. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Please correct me if i am going wrong somewhere. |
Yes, you are.
Variable records may become longer or shorter (hence the term variable). This does not mean there is something missing.
Two common ways to have variable length data are to:
Have multiple record layouts of different length
and/or
Have OCCURS DEPENDING ON as part of the record definition.
In neither case is anything missing.
And yes, looking at variable length data via EDIT or BROWSE might be confusing if you do not understand the data layout.
Quote: |
Also if the record shrinks then even in 3.4 we will not get proper results. |
Not true - the data will be the data. It is up to you to understand the data. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Quote: |
I am bit confused as in a discussion i came across that the record in the file would shrink,... |
Only if the record was made of wool, or if left in the dryer too long. |
|
Back to top |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
Thanks |
|
Back to top |
|
|
|