Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Variable length file and a missing value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Thu Jan 07, 2010 11:54 pm    Post subject: Variable length file and a missing value
Reply with quote

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
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jan 08, 2010 12:13 am    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jan 08, 2010 8:28 pm    Post subject: Re: Variable length file and a missing value
Reply with quote

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
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Fri Jan 08, 2010 11:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Jan 08, 2010 11:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jan 09, 2010 1:24 am    Post subject:
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sat Jan 09, 2010 7:15 am    Post subject:
Reply with quote

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. icon_lol.gif
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Mon Jan 11, 2010 12:58 am    Post subject:
Reply with quote

Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us