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
 
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
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm

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