IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How do you retrieve the data from a nullable column


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandy_mcs

New User


Joined: 01 Apr 2006
Posts: 17
Location: Pune

PostPosted: Mon Apr 17, 2006 7:10 pm
Reply with quote

I know
we use null indicators. Syntax ... INTO: HOSTVAR: NULLIND
But what is to be specified in NULLIND
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Apr 17, 2006 10:58 pm
Reply with quote

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

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Tue Apr 18, 2006 11:10 am
Reply with quote

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

New User


Joined: 03 Apr 2006
Posts: 1

PostPosted: Tue Apr 18, 2006 1:40 pm
Reply with quote

we can retrieve data from a nullable column using ' Is null ' clause
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Structured Data and Nested Loops via ... COBOL Programming 0
No new posts Alternate key data extracttion COBOL Programming 13
No new posts Extract ISPF table column headings CLIST & REXX 2
Search our Forums:


Back to Top