Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Difference between Null values and Low values

 
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:37 pm    Post subject: Difference between Null values and Low values
Reply with quote

Hi,

What's the difference between Null values and Low Values ?

I want to know it in case of both File and DB2 table.

What are Null values and Low values in a file?

What are Null vlaues and Low values in a DB2 table?

Thanks
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7935
Location: Bellevue, IA

PostPosted: Thu Jan 07, 2010 11:41 pm    Post subject:
Reply with quote

NULL means the variable has no value -- LOW-VALUES is a value of hexadecimal zeroes. You cannot have NULL values in a file since NULL values means there's a SECOND field that specifies whether or not the variable has data in it. DB2 supports NULL values as it is a database concept, not a file concept.
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 12:10 am    Post subject: Reply to: Difference between Null values and Low values
Reply with quote

Some people interchangeably speak Null or Low values, stating that somethimes low values are to be considered as Null, i am bit confused?

What's the cause of occurence of Low value and High value, and why do they occur?

How absence of values are treated in a file? As we say absence of value in a table implies Null; can we have absence of value in a file?

--Thanks
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7935
Location: Bellevue, IA

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

The confusion comes because C and similar languages use the concept of a null-terminated string (which is a string of bytes that ends with a LOW-VALUE or x'00' which means no bits are set). The null in null-terminated is not the same as the concept of NULL in a database (which means the variable has no value, and that requires an indicator flag that can be set to true if the variable is NULL and false if the variable has a value). HIGH-VALUE is x'FF' which means all bits are set. In any given collating sequence (EBCDIC, ASCII, or whatever), LOW-VALUE is the first byte in the collating sequence while HIGH-VALUE is the last value in the collating sequence.

The absence of values in a file means there's no data there -- period. The file is empty and has no records. If there are data records in a file, there are no missing values -- every byte means something in a file and you cannot have missing values (as I said in reply to your other post).
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:51 am    Post subject:
Reply with quote

Thanks Robert.

Just imagine that a file has some fields say - Account Number, Name, Address, Account Opening Date and some more.

Suppose, just a assumption and imagination that a person's Address is not available; then how would the file look like.

How do Low values and High values occur in a file or DataBase?

How a descision is taken for Low values and High values in a file or Data Base? By decision i mean how it is determined that field should have either Low val or High val?


Thanks
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7935
Location: Bellevue, IA

PostPosted: Mon Jan 11, 2010 1:52 am    Post subject:
Reply with quote

Depending upon the application, the address could have spaces in it or low values or high values or anything else -- whatever the application determines should be placed in the file. However, there will be something in those bytes -- they will be present in the file with some value. Low values and high values have no specific meaning in a file -- it depends entirely upon the application. Some databases may denote specific meanings to low values or high values in some cases, but again it depends upon the database software and the application that is using those fields.

The decision to use low values or high values tends to occur during the design process; however, this is not a fixed and firm rule. For example, if the design process determines a field in a file should be a 2-byte binary field (COMP in COBOL terms), then a velue of zero for that field is x'0000' while a value of -1 for that field is x'FFFF' -- in this case both low values and high values have specific meanings for the field even though neither was probably specifically considered during the design. So sometimes the design includes them on purpose, sometimes by accident, sometimes neither one is used.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Jan 11, 2010 1:59 am    Post subject: Reply to: Difference between Null values and Low values
Reply with quote

Speaking only from a file perspective, each field (IE: Account Number, Name, Address, Account Opening Date, etc), have a pre-defined fixed-length area in the record layout.

Depending on the IN-HOUSE requirements, if a given field is initialized with LOW-VALUES, SPACES, HIGH-VALUES or some other SITE DEPENDENT default value, then this is how a given field can be recognized as not being present.

I can't speak for a DB definition/design, but I'm sure someone else will jump in....

Bill

PS. Robert was seven minutes ahead.... icon_wink.gif
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: Mon Jan 11, 2010 3:18 am    Post subject:
Reply with quote

Hello,

Quote:
Suppose, just a assumption and imagination that a person's Address is not available; then how would the file look like.
Depends on the file specifications. If this is a delimited file,there would be 2 delimeters in a row to signify the "empty" field.

The decision of how to create data is completely site/application specific. Everything you mentioned mght be done one place or another. All are valid.

If you are reading a file, you have to follow the rules that created the file. If you are generating a new output file, you may be permitted to "roll your own". Porbalby not as there are likely standards about this.

Same with database info. There are local rules about how data will be defined and populated.
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 Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us