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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts variable in library name within a PROC. JCL & VSAM 11
No new posts Create a FTP record with help of SYNC... SYNCSORT 3
No new posts Starting a PROC with parameters from ... CLIST & REXX 6
No new posts How can I add/create a new INIT(initi... TSO/ISPF 2
Search our Forums:


Back to Top