View previous topic :: View next topic
|
Author |
Message |
devagarwal
New User
Joined: 24 Mar 2008 Posts: 8 Location: Bangalore
|
|
|
|
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 |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
if RXSQL, test RXSQL_SQLCODE
if DSNREXX, test SQLCODE |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
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 |
|
|
devagarwal
New User
Joined: 24 Mar 2008 Posts: 8 Location: Bangalore
|
|
|
|
Hi,
I have to pass the sqlcode back to the JCL from a REXX program.
With Regards,
Dev |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
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? |
|
Back to top |
|
|
devagarwal
New User
Joined: 24 Mar 2008 Posts: 8 Location: Bangalore
|
|
|
|
Hi acevedo,
A non-zero return code would suffice. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Including a +100 which can come after multiple SQLCODE 0 ?? |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
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 |
|
|
|