|
View previous topic :: View next topic
|
| Author |
Message |
sandy_mcs
New User
Joined: 01 Apr 2006 Posts: 17 Location: Pune
|
|
|
|
I know
we use null indicators. Syntax ... INTO: HOSTVAR: NULLIND
But what is to be specified in NULLIND |
|
| Back to top |
|
 |
DavidatK
Active Member

Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Hello Sandy,
the NULLIND is defined as a half word binary field: PIC S9(4) COMP.
The value populated in this field for nullable columns is 0= value is NOT NULL, -1= value is NULL. If the value is NULL, the value in HOSTVAR is unknown (usually low-values)
Dave |
|
| Back to top |
|
 |
twissi
Active User

Joined: 01 Aug 2005 Posts: 105 Location: Somerset, NJ
|
|
|
|
Hello Sandy,
In a fetch operation you don't have to specify any thing in NULLIND, it just gets populated as Dave said.
If you're fetching a table with one(or more) of the fields declared as NOT NULL into a copybook, you'll need to modify the DCLGEN to have a null indicator variable in the copybook. Depending on the value of NULLIND, you should populate this indecator variable(with a question mark or something).
This's just one way of handling nulls, this's helpful in unloading tables into flat files and then used to load other tables(widely used in migration systems.)
Any questions, please let me know.
Cheers, Twissi. |
|
| Back to top |
|
 |
kotireddy
New User
Joined: 03 Apr 2006 Posts: 1
|
|
|
|
| we can retrieve data from a nullable column using ' Is null ' clause |
|
| Back to top |
|
 |
|
|