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
 

 

Need help to create one QMF proc

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Need help to create one QMF proc
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    Post subject:
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    Post subject:
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    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 REXX to view the PGM or PROC jackzhang75 CLIST & REXX 11 Tue Jun 20, 2017 1:20 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am
No new posts Jcl pram vs proc parms ashek15 JCL & VSAM 3 Thu Mar 30, 2017 6:50 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


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