View previous topic :: View next topic |
Author |
Message |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Wed Mar 07, 2007 4:06 am Post subject: Trapping SQLCODE in REXX |
|
|
Hi,
Is it possible to trap the SQLCODE in REXX after a query is run thru DSNTEP2 utility?
Following are the details:
=> I am calling DSNTEP2 from REXX using queues.
Code: |
QUEUE "RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) ",
"LIBRARY('AAAA.BBB') PARMS('CCCC')"
QUEUE "END"
QUEUE |
=> I am able to get the output of the query (Which I have written in the
SYSIN card) in the SYSPRINT file. I am able to find the sqlcode in the
file.
=> Is it possible to trap the SQLCODE once the query gets executed?
Please let me know if I need to provide any other information regarding the same.
Thanks,
Vivek G |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Mar 07, 2007 4:16 am Post subject: |
|
|
RC is set after each EXECSQL if you used DSNREXX. It is also set if you use ADDRESS TSO "RUN.... |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Mar 07, 2007 4:23 am Post subject: |
|
|
Sorry, brain-fade (and so early in the day too!) - SQLCODE is returned in the Rexx equivalent of the SQLCA if you use DSNREXX. I guess for RC what is set is the RC from DSNTEP2 not the SQLCODE. If your output is written to a file then you can 'scrape' that to get the SQLCODE. But maybe someone else has a better solution. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Wed Mar 07, 2007 4:29 am Post subject: |
|
|
Nic Clouston,
I am trying to get some examples on how to use DSNREXX.
Can you provide me some example on how to execute a query using DSNREXX?
Thanks,
vivek G _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12381 Topics: 75 Location: San Jose
|
Posted: Wed Mar 07, 2007 5:54 am Post subject: |
|
|
vivek1983 wrote: | Nic Clouston,
I am trying to get some examples on how to use DSNREXX.
Can you provide me some example on how to execute a query using DSNREXX?
Thanks,
vivek G |
Please search before posting. Search the board for "Dsnrexx" and you will find many topics
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Mar 07, 2007 6:01 am Post subject: |
|
|
Also, I wrote my examples by referring to the DB2 manual - Application Programming and SQL guide and in particular chapter 9 _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
|
|