|
View previous topic :: View next topic
|
| Author |
Message |
AlexSalas95
New User
.jpg)
Joined: 18 Mar 2024 Posts: 21 Location: United States
|
|
|
|
To preface, I've found other forum posts that state it's not possible to execute REXX scripts through JCL via instream data, as opposed to a partitioned data set member.
However, this IBM doc seems to suggest it is possible (I think); https://www.ibm.com/docs/en/zos/2.5.0?topic=routine-using-irxjcl-execute-in-stream-rexx-exec
Here's the JCL used;
| Code: |
//SEQLEXEC JOB /
//****************************************************************
//* JCL to demonstrate use of 1-byte hex-zero char as null-name
//* to be used to execute an in-stream SYSEXEC file as a SEQ
//* in-stream REXX exec.
//*
//* The '~' character within the PARM="~ ..." parameter represents
//* a null character, (x'00').
//*
//* If your in-stream REXX exec contains any comment starting with
//* a '/*', the '/*' should not start in column 1 anywhere within
//* the in-stream exec.
//****************************************************************
//STEP1 EXEC PGM=IRXJCL,PARM='~ MY_INPUT_DATA_TO_REXX'
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//SYSEXEC DD *
/* REXX : In-line sequential exec */
PARSE ARG INPUT
SAY "HELLO WORLD! DATE = "DATE()", TIME = "TIME()
SAY "INPUT TO THIS EXEC IS <"INPUT">"
PARSE SOURCE SRC_STRING
SAY "SOURCE_STRING => <"SRC_STRING">"
EXIT 0
/*
|
I've tried this, as well as a dozen or so different mutations but can't get it to execute properly. I get one of the two errors below;
| Code: |
| IRX0408E Exec member name must not be specified when exec load DD refers to a sequential data set. |
or
| Code: |
| IRX0551E The exec load file SYSEXEC must be allocated to either a partitioned or sequential data set. |
So, is IBM just goading me? Or am I completely misunderstanding the documentation?
Also, has anyone had success executing REXX scripts instream using another method? |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1430 Location: Bamberg, Germany
|
|
|
|
It works as expected, and does not even require the REXX identifier.
| Code: |
//IRXJCLZ EXEC PGM=IRXJCL,PARM='.' <* Parm is X'00'
//SYSEXEC DD DATA,DLM=##
Say "Hello World!"
##
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY |
|
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 772 Location: Denmark
|
|
|
|
Also, you can follow the x'00' with one blank and the actual parameter, i.e.
//IRXJCLZ EXEC PGM=IRXJCL,PARM=' howdy'
Say "Hello World" arg(1) |
|
| Back to top |
|
 |
AlexSalas95
New User
.jpg)
Joined: 18 Mar 2024 Posts: 21 Location: United States
|
|
|
|
Interesting
I tried executing the exact same JCL, but it still fails with the same error;
| Code: |
| IRX0408E Exec member name must not be specified when exec load DD refers to a sequential data set. |
Was I meant to change DD DATA? |
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 772 Location: Denmark
|
|
|
|
| Are you sure that you have a binary zero (x'00') as the first byte of the parm ? |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1430 Location: Bamberg, Germany
|
|
|
|
| What is the RC you are receiving? |
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 772 Location: Denmark
|
|
|
|
If you are using the JCL that you showed:
//STEP1 EXEC PGM=IRXJCL,PARM='~ MY_INPUT_DATA_TO_REXX'
then the 1st byte of the parm is not x'00' |
|
| Back to top |
|
 |
AlexSalas95
New User
.jpg)
Joined: 18 Mar 2024 Posts: 21 Location: United States
|
|
|
|
That was it!
I'd like to put all the blame on my editor of choice (IDz), but reading comprehension was my real enemy here
After realizing that the first character had to actually be null instead of an empty space, I couldn't quite figure out how to enter one within IDz.
Ultimately, I went into 3.4, turned hex on and change it accordingly. I realize how trivial that sounds, but it's a big win for me.
Thanks @Joerg.Findeisen and @Willy Jensen |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1430 Location: Bamberg, Germany
|
|
|
|
Thanks for letting us know.  |
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 772 Location: Denmark
|
|
|
|
alternatively, you can do an edit command
c '~' x'00' |
|
| Back to top |
|
 |
vasanthz
Global Moderator

Joined: 28 Aug 2007 Posts: 1750 Location: Tirupur, India
|
|
|
|
Thank you, I learnt something new
This looks better than IKJEFT for testing and development. |
|
| Back to top |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2624 Location: Silicon Valley
|
|
|
|
re: This looks better than IKJEFT
It depends on your needs. I do not think can issue TSO commands from IRXJCL. There may be other restrictions. |
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 772 Location: Denmark
|
|
|
|
| One obvious restriction is that you cannot include other REXXs neither from SYSEXEC nor from SYSPROC. |
|
| Back to top |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1323 Location: Vilnius, Lithuania
|
|
|
|
Same difference:
| Code: |
//* Use a tiny Rexx exec to check both month and year
//* If 1st of month, return number of month, else return 99
//* https://ibmmainframes.com/viewtopic.php?t=42579
//MAKEREXX EXEC PGM=IEBUPDTE,
// PARM=NEW
//SYSIN DD DATA
./ ADD NAME=CHKDATE
if substr(date('S'), 7, 2) = '01' then
return substr(date('S'), 5, 2)
return 99
/*
//SYSUT2 DD DISP=(,PASS),
// SPACE=(TRK,(1,1,2),RLSE),
// UNIT=VIO,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=80,DSORG=PS)
//*
//SYSPRINT DD DUMMY
//**********************************************************************
//* Now run the exec to get a return code
//**********************************************************************
//SETMAXCC EXEC PGM=IRXJCL,
// PARM='CHKDATE'
//*
//SYSEXEC DD DSNAME=*.MAKEREXX.SYSUT2,
// DISP=(OLD,PASS)
//*
//SYSTSIN DD DUMMY
//SYSTSPRT DD DUMMY
//**********************************************************************
//* Proceed as in other solutions
//**********************************************************************
//JAN EXEC PGM=IEFBR14,COND=(1,NE,SETMAXCC)
//*
//FEB EXEC PGM=IEFBR14,COND=(2,NE,SETMAXCC)
//*
// ... |
And obviously you can concatenate your standard SYSEXEC datasets to the temporary one to call other execs. |
|
| Back to top |
|
 |
|
|