IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need help to create one QMF proc


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shailendra tripathi

New User


Joined: 05 Jan 2007
Posts: 5
Location: Pune

PostPosted: Thu Apr 22, 2010 7:46 pm
Reply with quote

Hi All,

Actually i have to create a qmf proc and the flow is like

1) select A from owner.tablename
where fielda = :value and
fieldb = ... so on

2) if sqlcode (record found) = 0

3) then perform an update on another table

4) else throw an error message

i am clear with how to supply value from proc to query but not sure how i can check this sqlcode and then do the update.

can somebody help me on this ???
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Fri Apr 23, 2010 5:39 pm
Reply with quote

I don't see how QMF proc would do this, but I'm pretty sure you can write an update on one table with a exists-where clause

Code:
update ...
from tab1 A

where exists (select * from tab2 B where B.col = &hv ...)
and A = &hv
Back to top
View user's profile Send private message
shailendra tripathi

New User


Joined: 05 Jan 2007
Posts: 5
Location: Pune

PostPosted: Mon Apr 26, 2010 11:07 am
Reply with quote

guys here is the stuff to do that

"GET GLOBAL(ROW_CNT = DSQAO_NUM_FETCHED"
IF ROW_CNT = 1 THEN

After running the select query we check for DSQAO_NUM_FETCHED, this will be zero if no record available.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
No new posts COBOL - create and write to output fi... COBOL Programming 0
No new posts Best way to create an automated line ... TSO/ISPF 3
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
Search our Forums:

Back to Top