Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Get RC of SQL query (inside rexx pgm)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
devagarwal

New User


Joined: 24 Mar 2008
Posts: 8
Location: Bangalore

PostPosted: Mon Mar 24, 2008 3:58 pm    Post subject: Get RC of SQL query (inside rexx pgm)
Reply with quote

My REXX exec contains an SQL query and I'm executing the REXX program through JCL. In case the RC of the SQL query is not 0, then I need to submit another job.

Is it possible to get the RC of the query?
Back to top
View user's profile Send private message

PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Mon Mar 24, 2008 6:13 pm    Post subject:
Reply with quote

if RXSQL, test RXSQL_SQLCODE

if DSNREXX, test SQLCODE
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Mon Mar 24, 2008 6:26 pm    Post subject: Re: Get RC of SQL query (inside rexx pgm)
Reply with quote

devagarwal wrote:
In case the RC of the SQL query is not 0, then I need to submit another job.


do you want to stablish the RC depending on the SQLCODE value?
Back to top
View user's profile Send private message
devagarwal

New User


Joined: 24 Mar 2008
Posts: 8
Location: Bangalore

PostPosted: Tue Mar 25, 2008 2:14 pm    Post subject:
Reply with quote

Hi,
I have to pass the sqlcode back to the JCL from a REXX program.

With Regards,
Dev
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Mar 25, 2008 2:43 pm    Post subject:
Reply with quote

Quote:

have to pass the sqlcode back to the JCL from a REXX program


suggest you read a little more. your level of understanding seems a little 'scant'.

Your REXX program that issued the sql calls, should also interrogate the sqlcode, then the rexx program can set a step return code (if you are using IKJEFT1b/1c 1a will not return a user set return code to mvs.)
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Mar 25, 2008 5:25 pm    Post subject:
Reply with quote

devagarwal wrote:
I have to pass the sqlcode back to the JCL from a REXX program.


what RC should you return to JCL in case of sqlcode -811? icon_question.gif
Back to top
View user's profile Send private message
devagarwal

New User


Joined: 24 Mar 2008
Posts: 8
Location: Bangalore

PostPosted: Wed Mar 26, 2008 9:38 am    Post subject: Reply to: Get RC of SQL query (inside rexx pgm)
Reply with quote

Hi acevedo,
A non-zero return code would suffice.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Wed Mar 26, 2008 11:42 am    Post subject:
Reply with quote

Including a +100 which can come after multiple SQLCODE 0 ??
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Wed Mar 26, 2008 3:04 pm    Post subject:
Reply with quote

Hi devagarwal !

>> I have to pass the sqlcode back to the JCL from a REXX program.

Example in Rexx-proc:

ADDRESS DSNREXX "EXECSQL FETCH C1 INTO :UKTOID"
IF SQLCODE ^= 0 THEN CALL SQLERROR

SQLERROR:
UMEYRC = SQLCODE
EXIT UMEYRC
RETURN


JobControl:

//STEP010 EXEC PGM=IKJEFT1B,
// PARM=('UMTEST')
//SYSPROC DD DISP=SHR,DSN=J120830.USER.CLIST
//SYSOUT DD SYSOUT=*
//SYSTSIN DD DUMMY
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
/*


SDSF-Output:

JOBNAME STEPNAME PROCSTEP RC EXCP
J120830X STEP010 100 16


Regards, UmeySan
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us