IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Get RC of SQL query (inside rexx pgm)


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 459
Location: Belgium

PostPosted: Mon Mar 24, 2008 6:13 pm
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
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
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: 6966
Location: porcelain throne

PostPosted: Tue Mar 25, 2008 2:43 pm
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
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
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: 459
Location: Belgium

PostPosted: Wed Mar 26, 2008 11:42 am
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: 771
Location: Germany

PostPosted: Wed Mar 26, 2008 3:04 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top