View previous topic :: View next topic |
Author |
Message |
Packi Beginner
Joined: 01 Jun 2007 Posts: 3 Topics: 2
|
Posted: Thu Jul 05, 2007 1:19 am Post subject: Moving Null Values to table fields |
|
|
what would happen if we move Null Values or Spaces to a table field through a cobol program? |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Jul 05, 2007 2:17 am Post subject: |
|
|
it would have null values or spaces in it _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Jul 05, 2007 2:24 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jul 05, 2007 3:38 am Post subject: |
|
|
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 - interrogation of the NULL-INDICATOR for that Column after retrieval of a row
- 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 |
|
 |
|
|