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
 
update in cobol for DB2 tables

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
gireesh.behara

New User


Joined: 09 Jul 2008
Posts: 2
Location: chennai

PostPosted: Wed Jul 09, 2008 2:56 pm    Post subject: update in cobol for DB2 tables
Reply with quote

Hi all

I am facing one problem while using the update statement in cobol.

Eg

Update EMP set sal=5000 where EMPID in(EMPLoyee ID's are in COBOL array)

How do i execute the above query for set of ID's

Any help would be greatful
Back to top
View user's profile Send private message

Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Jul 09, 2008 3:49 pm    Post subject: Reply to: update in cobol for DB2 tables
Reply with quote

Hi,

You can do this in a loop with a varying index.

Code:
PERFORM UPDATE-PARA VARYING WS-INDX FROM 1 BY 1
UNTIL WS-INDX = X (Maximum value of the array)


UPDATE-PARA.

UPDATE EMP set sal=5000 where EMPID = WS-EMP-ID-ARR(WS-INDX)
Back to top
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Thu Jul 17, 2008 4:36 pm    Post subject: Reply to: update in cobol for DB2 tables
Reply with quote

Is this a static or dynamic array? The no of EMPID keeps on changing each time or is it constant?
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Thu Jul 17, 2008 4:46 pm    Post subject:
Reply with quote

Quote:

Is this a static or dynamic array?


?

Quote:

The no of EMPID keeps on changing each time or is it constant?


ans

Quote:

How do i execute the above query for set of ID's
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Identify top 30 big tables or indexes... ashek15 DB2 0 Fri Jun 16, 2017 10:01 am
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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