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

getting RC=3650 when invoking REXX with JCL


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 22
Location: Germany

PostPosted: Mon Apr 12, 2021 10:12 am
Reply with quote

Hi everyone,

I am trying to invoke my REXX program in JCL using the simple code:
Code:
 
//STEP1   EXEC PGM=IRXJCL,REGION=0K,PARM='XXXXX'   
//SYSEXEC   DD DSN=MYDS.REXX.LIB,DISP=SHR     
//SYSTSPRT  DD SYSOUT=*                               
//SYSTSIN   DD DUMMY,BLKSIZE=80                       


but I get RC=3650 because the
Code:
 ADDRESS TSO 'SUBCOM DSNREXX'
gets RC=(-3).
I don't know why it can't connect to DB2.
By the way, when I execute my program directly (without JCL) it works fine.

Anybody has any idea about it?

Thanks in advance,
Mahsa Rouzkhatouni
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 475
Location: Bamberg, Germany

PostPosted: Mon Apr 12, 2021 10:16 am
Reply with quote

Your address statement seems wrong.

See https://www.ibm.com/docs/en/db2-for-zos/12?topic=ratiss-accessing-db2-rexx-language-support-application-programming-interfaces
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 22
Location: Germany

PostPosted: Mon Apr 12, 2021 10:27 am
Reply with quote

Quote:
Your address statement seems wrong.


wrong how?
in my REXX code I have this:
Code:

 ADDRESS TSO 'SUBCOM DSNREXX'               
  IF RC THEN ,                               
  S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
  ADDRESS DSNREXX                           
  'CONNECT' 'DSNT'                   
                             


Since I've always executed this directly from TSO and it works fine, I don't know which one to change.
I read the link you gave and it seems ok, only I have the extra "ADDRESS TSO" part.
Should I ommit it?
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 22
Location: Germany

PostPosted: Mon Apr 12, 2021 10:44 am
Reply with quote

Quote:
Your address statement seems wrong.


ok I tried omitting the Address TSO part and it passed that error. SO lesson learnt was I don't need tso environment for this.

I now have to mention every dataset that I allocated in my REXX and probably face multiple problems.

Thanks Joerg for your answer ^_^
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 450
Location: Denmark

PostPosted: Mon Apr 12, 2021 1:58 pm
Reply with quote

I think that you need to change your logic.
IF RC THEN ,
is not good. You shuld do
Code:
  IF RC=0 THEN DO
   S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
   ADDRESS DSNREXX                           
   'CONNECT' 'DSNT'
  END

and perhaps also testing the value of S_RC before continuing.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10773
Location: italy

PostPosted: Mon Apr 12, 2021 2:18 pm
Reply with quote

the Address TSO statement is not wrong in se
the TSO environment is not available when using IRXJCL

the manuals are pretty clear on the environments available for each type of invocation

PS..
if a script is designed to be executed only in batch let the jcl handle the dataset allocations
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 22
Location: Germany

PostPosted: Mon Apr 12, 2021 2:43 pm
Reply with quote

Quote:
the TSO environment is not available when using IRXJCL

Thanks, exactly that was the problem, I should use IKJEFT01 for TSO.

Quote:
if a script is designed to be executed only in batch let the jcl handle the dataset allocations

well since I first wrote the REXX program without considering JCL, I'm not sure how I exactly should change my code for datasets to be managed by JCL. But it's definitely something I'm gonna work on now.

Thanks for the idea, I hope I can get it right.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10773
Location: italy

PostPosted: Mon Apr 12, 2021 5:17 pm
Reply with quote

Quote:
well since I first wrote the REXX program without considering JCL, I'm not sure how I exactly should change my code for datasets to be managed by JCL.


since EXECIO wants the DDNAME you do not need to add anything,
just remove the allocation
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts rexx pgm to create multiple ps file IBM Tools 7
No new posts Mainframe batch Job or REXX to get VT... CLIST & REXX 7
No new posts calling OMEGAMON from REXX CLIST & REXX 3
No new posts REXX allocated datasets in JCL CLIST & REXX 9
No new posts A Rexx who changes date into a JCL? P... CLIST & REXX 9
Search our Forums:

Back to Top