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

REXX allocated datasets in 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: 32
Location: Germany

PostPosted: Mon Apr 12, 2021 12:21 pm
Reply with quote

Hi ,

I've asked a question about invoking REXX within jcl in here
and I am not sure if I had to ask this question here or continue that...

So the question is, how should I correctly specify DDNAMEs in JCL that are allocated in REXX? I have this in my REXX:
Code:
 "ALLOC F(OT1) DS('MYDS.INPUT(MEMBER)') SHR"

and this in my JCL:
Code:

//STEP1   EXEC PGM=IRXJCL,REGION=0K,PARM='XXXXX'         
//OT1     DD DSN=MYDS.INPUT(MEMBER),DISP=SHR


but I still get RC(-3) with no explanation. any thoughts?

Thanks in advance
Mahsa Rouzkhatouni
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

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

You don't allocate datasets in your REXX that are already allocated by JCL, what would be the purpose? If you need to reallocate then you either do a FREE before ALLOCATE or add the REUSE parameter to the ALLOCATE.
I do wonder about the rc -3 though. Are you in the TSO or MVS environment at the time? When in doubt do ADDRESS TSO in front, though that would require you use PGM=IKJEFT01 instead of IRXJCL, which I would recommend in any case. I think that you can use ADDRESS MVS ALLOCATE .. with IRXJCL, but I'm not sure.
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 32
Location: Germany

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

Quote:
You don't allocate datasets in your REXX that are already allocated by JCL.

well I first wrote my REXX code then decided to invoke it by JCL. and for that I need to name each of the datasets that I allocated in REXX. By the way, as I understand, I MUST allocate my datasets in REXX as I am doing a ton of read/write work with them. I have to allocate them, right??

Quote:
I do wonder about the rc -3 though. Are you in the TSO or MVS environment at the time?

Yes before the ALLOCATE command I have an "ADDRESS TSO" part.

Quote:
use PGM=IKJEFT01 instead of IRXJCL, which I would recommend in any case.

EXACTLY... thanks. That is what I have to do. just now I changed IRXJCL with IKJEFT01 and the allocation worked beautifully.
However now I get another RC(-3) for the
Code:
 ADDRESS ISPEXEC "SELECT PGM(ISRSUPC) PARM("PARMS")"

its changing environment again, shouldn't it be ok with IKJEFT01?? icon_sad.gif
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2022
Location: USA

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

Generally speaking, it is not good idea to mix together both static allocation (via DD statement), and dynamic allocation (via TSO ALLOC, or other allocation programs) - for the same DD-names. In 99.99% of cases there is no objective to do so, but it may cause other problems while there is lack of understanding of zOS internals involved into this process.
Do not make your life harder for no reason.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Mon Apr 12, 2021 6:03 pm
Reply with quote

To use ISPF services, ISPF requires a number of datasets allocated and that the command is started by the ISPSTART or PDF command.
Something like:
Code:
//BE       EXEC PGM=IKJEFT1B,PARM='ISPSTART CMD(%your-command)'     
//SYSEXEC  DD DISP=SHR,DSN=system.exec.lib                         
//SYSTSPRT DD SYSOUT=*                                         
//SYSTSIN  DD DUMMY                                             
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU                         
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU                         
//ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSENU                         
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU                         
//ISPPROF  DD UNIT=SYSDA,SPACE=(TRK,(5,5,5)),RECFM=FB,LRECL=80 
//ISPLOG   DD DUMMY SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129     
//ISPFILE  DD SYSOUT=*,RECFM=FB,LRECL=80,BLKSIZE=6240           
Back to top
View user's profile Send private message
hankoerlemans

New User


Joined: 25 Jan 2018
Posts: 57
Location: Australia

PostPosted: Tue Apr 13, 2021 7:55 am
Reply with quote

You really don't need to run ISRSUPC out of ISPF.
The ISPF dialogs support batch running and it's likely that SISPSLIB(ISRSBJCL) is utilized to massage the JCL.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Apr 13, 2021 10:12 am
Reply with quote

read the ISPF manuals on how to run ISRSUPC as a pure batch program ...

something like this for a search

Code:
****** ***************************** Top of Data ******************************
 - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  2 Line(s) not Displayed
 000003 //ISR    EXEC PGM=ISRSUPC,                                           *
 000004 //            PARM=(SRCHCMP,'LNFMTO')
 000005 //NEWDD    DD DISP=SHR,DSN=<YOUR PDS>
 000006 //OUTDD    DD SYSOUT=(*)
 000007 //SYSIN    DD *
 000008 SRCHFOR  '<YOUR SEARCH STRING>'
 000009 /*
 ****** **************************** Bottom of Data ****************************


here is the link to the relevant manual with the sample jcl snippets

www.ibm.com/docs/en/zos/2.2.0?topic=search-examples
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Apr 13, 2021 1:26 pm
Reply with quote

Good point, but in general when you use ADDRESS ISPEXEC then the ISPF environment and thus dataset allocations must be there.
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 32
Location: Germany

PostPosted: Tue Apr 13, 2021 7:21 pm
Reply with quote

Thanks guys,
I'm studying ISPF DDNAMEs and trying different things based on your suggestions.

Thanks for all your help.
I'll be back if anything abnormal came up.
Back to top
View user's profile Send private message
Mahsa Rouzkhatouni

New User


Joined: 27 Feb 2021
Posts: 32
Location: Germany

PostPosted: Wed Apr 14, 2021 9:42 am
Reply with quote

Quote:
ISPF requires a number of datasets allocated and that the command is started by the ISPSTART or PDF command.


Ok so I studied it and finally what did work was to change "ADDRESS ISPEXEC" with
Code:
 ADDRESS LINKMVS "ISRSUPC PARMS"

and it worked nicely.

So for this step I am done and the program works fine.
However I'm gonna work on the allocation of my datasets to give the JCL their control.It's something new for me to study.

Many thanks to you all.
Mahsa Rouzkhatouni
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 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