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 

Moving Null Values to table fields

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


Joined: 01 Jun 2007
Posts: 3
Topics: 2

PostPosted: Thu Jul 05, 2007 1:19 am    Post subject: Moving Null Values to table fields Reply with quote

what would happen if we move Null Values or Spaces to a table field through a cobol program?
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: Thu Jul 05, 2007 2:17 am    Post subject: Reply with quote

it would have null values or spaces in it
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
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: Thu Jul 05, 2007 2:24 am    Post subject: Reply with quote

of course the field should be defined to take such values - basically a PIC X field. If you are talking about columns in a table rather than the field in your program then the same applies - but the column may have been set up with NOT NULLS in which case you would get a negative sqlcode.

Same with any language I know, not just COBOL
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jul 05, 2007 3:38 am    Post subject: Reply with quote

Packi,

you intermixing of keywords, fields, table, Null Value, is confusing.

fields are a program data definition.
a COBOL Table contains items comprising of fields.

columns are a DB2 definition of a discreet data area (could be thought of as a field, but it is called a column).
A DB2 Table contains Rows comprising of Columns.

NULL Value is not a COBOL term.
Low-values (hex '00') is the Reference used when MOVEing, comparing(IF/WHEN).
Enterprise Cobol allows for a NULL delimited string (hex '00') - (a variable length string) in order to be compatible with the PC world and the C language.

NULL Value is a DB2 term, meaning the Column contains no-value. As Nic said, the Column must be defined as NULLABLE.
You determine if a NULLABLE Column is NULL or contains a NULL Value thru
  1. interrogation of the NULL-INDICATOR for that Column after retrieval of a row
  2. comparison, setting to NULL in SQL
.
Moving Low-values to a Char column is not the same as setting the Value for a Column to NULL.

Spaces are spaces; considered character data in DB2, string or X-type data in COBOL.
_________________
Dick Brenholtz
American living in Varel, Germany
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