Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 Null handling in COBOL

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

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Aug 02, 2006 11:07 am    Post subject: DB2 Null handling in COBOL
Reply with quote

Hi All,

I have a query to update a row in a table.
UPDATE EMPL_TBL EMP
SET EMP.PERMENANT_IND = 'Y'
WHERE EMP.EMP_ID = :EMP-EMP-ID
AND EMP.EMP_NAME = :EMP-NAME
AND EMP.CITY = :EMP-CITY
Now I have to update permanent flag for an employee with id as 1 and name 'peter ' and city as null,

Could any one let me know will it be possible to do this using null indicator var with EMP-CITY variable while embedding this query in COBOL.

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

anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Wed Aug 02, 2006 11:37 am    Post subject:
Reply with quote

It should be possible to do this using null indicators; before update statement Move -1 to the appropriate null indicator and then when you issue the SQL update use EMPCITY= :EMP-CITY:null-ind-varaiable. Try this out, it should be fine.

The other method ofcourse without using the null varaiable is to issue sql update with EMPCITY=NULL.
Back to top
View user's profile Send private message
HARIBHARAT

New User


Joined: 05 Jul 2006
Posts: 65
Location: pune

PostPosted: Wed Aug 02, 2006 1:12 pm    Post subject: Re: DB2 Null handling in COBOL
Reply with quote

Db2 we have null indicator , which field u want to set null, that field field u pass the value -1 . Then update query.

Regards

suresh
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us