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 

Handling Null Indicators for cobol stored proc

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


Joined: 23 Dec 2004
Posts: 8
Topics: 4

PostPosted: Thu Dec 23, 2004 1:11 pm    Post subject: Handling Null Indicators for cobol stored proc Reply with quote

We have written a cobol db2 stored proc program with Generate with Nulls option. We are calling this stored proc from db2 command center.
From the stored proc we are getting one amount field (decimal) and date field as null values. How to handle this null values in the cobol program. Our stored proc abends whenever we get null values. We do insert and update in this program. In the databse those fields are delcared as nullable.

Declared this in Linkage section
01 IND-PARM.
05 IN-AMT-IND PIC S9(4) COMP.
05 IN-DT-IND PIC x(26).

01 INPUT-VAR.
05 IN-AMT PIC S9(4) COMP.
05 IN-DT PIC x(26).

PROCEDURE DIVISION USING IN-AMT,
IN-DT.

EXEC SQL
INSERT
INTO X
(amt, dt) values :IN-AMT
IN-AMTAST-IND
, IN-DT
IN-DT-IND
END-EXEC

Do we need to give IND-PARM in procedure devison using variabl?
Do we need todo anything? Please advise.

Thanks in advance.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Dec 23, 2004 2:06 pm    Post subject: Reply with quote

sant_1028,

Check this topic which discusses a similar issue

http://www.mvsforums.com/helpboards/viewtopic.php?t=2565&highlight=stored+procedure

Also check out this redbook which explains in detail about SP's

http://www.redbooks.ibm.com/abstracts/sg247083.html?Open

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database 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