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
 

 

Unable to understand why Null indicator is used here

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
vab987

New User


Joined: 01 Dec 2006
Posts: 29
Location: S.A

PostPosted: Tue May 15, 2007 1:49 pm    Post subject: Unable to understand why Null indicator is used here
Reply with quote

Hi,

What does W00-Null-Ind tells in this Select querry.

W00-NULL-IND variable is of S9(4), initialized as 0.

Querry is :

EXEC SQL
SELECT CUST_ACNT_N
,CLOSD_D
,CENT_FULL_IBT_N
INTO :DCLACNT.CUST-ACNT-N
,:DCLACNT.CLOSD-D:W00-NULL-IND
,:CENT-FULL-IBT-N
FROM IBIS.CUST_ACNT
,IBIS.CENTRE
WHERE CUST_ACNT_N = :DCLACNT.CUST-ACNT-N
AND CENTR_N = CENT_CENTR_N
WITH UR
END-EXEC

I am unable to understand why this W00-NULL-IND is used ??

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

ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Tue May 15, 2007 2:26 pm    Post subject:
Reply with quote

Hi,

If a column is Not null and the null indicator will have the information as whether the column has some data or it is null.

In your case you select that indictor values into your variable W00-NULL-IND.

Depending upon the value you will populate the values in DCLACNT.CLOSD-D.

As if W00-NULL-IND = 0

we assume that the column contains some value.

If you doesn't handle the null indicator you will get -305 (as you might be aware)

Cheers
Ashwin
Back to top
View user's profile Send private message
vab987

New User


Joined: 01 Dec 2006
Posts: 29
Location: S.A

PostPosted: Fri May 18, 2007 4:17 pm    Post subject:
Reply with quote

Hi Ashwin,

Thanks a lot.... but couldn't understand abt Handling null indicator.
Do u man that if we don't check the Null indicator (whether it contains zeros or some value ), we will get some error ?


Thanks in advance
Vab
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: Sat May 19, 2007 2:40 am    Post subject:
Reply with quote

Hello,

On data that may be NULLed, you must check the null indicator to see if you have data before using it. Only when there actually is data should you use the data.

If you use the data and there was none (i.e. it was null), your results may vary (anything from incorrect processing to an abend).
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Need to understand TCB CPU and SRB CPU gandikk Testing & Performance analysis 11 Mon Mar 20, 2017 9:32 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm


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