View previous topic :: View next topic |
Author |
Message |
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Thu Dec 22, 2005 4:15 am Post subject: Newbie Qn in QMF |
|
|
I simply want to run a series of SQL using QMF. What I know is this can be achieved using PROC. I am able to run the query when running from QUERY panel (PF6 from QMF), the same, when I try to run from PROC panel, (PF10) they are not getting executed
Say, I am trying to run the following query using PROC panel
SELECT COUNT(*) FROM DBZ1.TABLE1;
What I get is,
SELECT is not a command
Anything in particular I need to take care while building the query to be used inside a PROC? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Dec 22, 2005 8:36 am Post subject: |
|
|
sakreg,
The idea of proc is to run multiple named queries but not queries within a proc.you need to save all your queries differently and then put the names of the queries
and run them
ex:
Code: |
SELECT COUNT(*) FROM TABLE1
|
now save this query as Q1
next query
Code: |
SELECT COUNT(*) FROM TABLE2
|
save this query as Q2
Now create a proc to save
Code: |
RUN QUERY Q1
RUN QUERY Q2
|
Btw you can do it only in batch mode. The interactive mode will only give you the results of the last query execueted.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Thu Dec 22, 2005 12:22 pm Post subject: |
|
|
Thanks kolusu, you gave me a lead to start with QMF Proc. |
|
Back to top |
|
|
yadav2005 Intermediate
Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Thu Apr 08, 2010 12:55 pm Post subject: |
|
|
Kolusu,
I am new to writing and executing a QMF proc , can you show an example and I do not know how to write / execute in QMF panel . I have a requirement where in I have a PDS member which contains sql statements . I want to do two things
a) replace the existing proc with the new member contents
b) execute the proc contents
Please help me in this regard.Thanks. |
|
Back to top |
|
|
yadav2005 Intermediate
Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Thu Apr 08, 2010 12:57 pm Post subject: |
|
|
Kolusu,
Can you show me a batch jcl to execute the QMF proc as per your contents i understand that only the last saved named query in the proc gets executed. |
|
Back to top |
|
|
yadav2005 Intermediate
Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Thu Apr 08, 2010 3:49 pm Post subject: |
|
|
Further if I would like to see the existing PROCs already created in QMF how can i see that ?.
I want to create a new one only if the name does not exist earlier. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Apr 08, 2010 4:55 pm Post subject: |
|
|
yadav2005 wrote: | Kolusu,
I am new to writing and executing a QMF proc , can you show an example and I do not know how to write / execute in QMF panel . |
Assuming you have access to QMF
1. Get to QMF
2. At the bottom of the screen you would see the function keys maping
3. Press PF6 for queries
4. You get an edit panel. Type in your query
5. Again see the bottom for the function key mapping
6. Press PF2 for running the query you just wrote.
Quote: |
I have a requirement where in I have a PDS member which contains sql statements . I want to do two things
a) replace the existing proc with the new member contents
b) execute the proc contents
Please help me in this regard.Thanks. |
1. On the QMF main panel at the bottom TYPE
LIST ALL.
This will show all your queries and procs that you are the owner of
once you get the pop up list press PF1 and read thru the various commands you can use against the list shown
Suggest you start reading this manual
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSQRF080/CCONTENTS?
For bringing in your contents from a pds , read the command IMPORT which is explained in the manual in detail
yadav2005 wrote: | Can you show me a batch jcl to execute the QMF proc as per your contents i understand that only the last saved named query in the proc gets executed. |
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSQI2071/2.12.4?
yadav2005 wrote: | Further if I would like to see the existing PROCs already created in QMF how can i see that ?.
I want to create a new one only if the name does not exist earlier. |
Use the command LIST PROCS and it will list all your procs associated with your ID as owner.
Last but not least read the manual and everything is explained in detail there
Kolusu |
|
Back to top |
|
|
yadav2005 Intermediate
Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Fri Apr 09, 2010 12:52 am Post subject: |
|
|
Thanks Kolusu,
You information is excellent. I was able to clearly follow your instructions and I am able to work with QMF procs .I have started practising them and concepts are clear.
Thanks once again. |
|
Back to top |
|
|
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Mon Apr 12, 2010 3:04 pm Post subject: |
|
|
There is a way you can run the Proc interactively and see the results between queries using the INTERACT command.
Example below:
Code: | "RUN QUERY WEEKLY_SALES_Q (FORM=WEEKLY_SALES_F"
"INTERACT"
"RUN QUERY YEAR_TOTAL_Q (FORM=YEAR_TOTAL_F" |
|
|
Back to top |
|
|
|
|