View previous topic :: View next topic
|
Author |
Message |
Mahsa Rouzkhatouni
New User
Joined: 27 Feb 2021 Posts: 32 Location: Germany
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1248 Location: Bamberg, Germany
|
|
Back to top |
|
|
Mahsa Rouzkhatouni
New User
Joined: 27 Feb 2021 Posts: 32 Location: Germany
|
|
|
|
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 |
|
|
Mahsa Rouzkhatouni
New User
Joined: 27 Feb 2021 Posts: 32 Location: Germany
|
|
|
|
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Mahsa Rouzkhatouni
New User
Joined: 27 Feb 2021 Posts: 32 Location: Germany
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
|