Page 1 of 1

Running a REXX program from the z/OS shells

PostPosted: Mon Jan 07, 2019 3:19 pm
by BonganiMabuza
Hi Guys ,

I'm trying to run Rexx Script from Z/OS on a text file but I get the below error

Here is my REXX code on a text file (see the uploaded 1.PNG):

/*REXX*/                                                                
 SAY "RUNNING REXX SCRIPT.."                                            
 SAY ""                                                                  
 "ALLOCATE DATASET('"Z30583.REX.DT"') NEW SPACE(2,1) DSORG(PS) RECFM(F)",
 "LRECL(80) BLKSIZE(32720)"                                              
 SAY "DONE EXECUTING REXX SCRIPT"  


When I execute the script on Z/OS shell I get the below error (see the uploaded 2.PNG):

FSUM7332 syntax error: got (, expecting Newline


Please assist

Re: Running a REXX program from the z/OS shells

PostPosted: Mon Jan 07, 2019 3:35 pm
by expat
I usually use this .....

But, why do you have the double quotes around the dataset name in your code, don't tghink that you need them
In my example I use them because SYSUID is a symbol which resolves to my user id


"ALLOC FI(IDCAMOUT) NEW TRACKS SPACE(15 15)
       DA('"
SYSUID".IDCAMOUT') RECFM(F B) LRECL(80) RELEASE"
 

Re: Running a REXX program from the z/OS shells

PostPosted: Mon Jan 07, 2019 4:30 pm
by NicC
1 - Use the code tags around code and data
2 - do not use images - a simple cut and paste with the code tags will do, is easier and takes less storage
3 - what was the result when you ran with a trace?

Re: Running a REXX program from the z/OS shells

PostPosted: Mon Jan 07, 2019 5:28 pm
by BonganiMabuza
Hi NicC,

Thanks for the update, I will keep in mind using the code tags around my code and not use images.

The code seems to be working well when I execute it under TSO/E.

Here are the result I get when I ran the code with trace('A') :
_______________________________________________________
    3 *-* SAY "RUNNING REXX SCRIPT.."                                          
RUNNING REXX SCRIPT..                                                          
     4 *-* SAY ""                                                              
                                                                               
     5 *-* "ALLOCATE DATASET('"Z30583.REX.DT"') NEW SPACE(2,1) DSORG(PS) RECFM(F
)"                                                                              
       >>>   "
ALLOCATE DATASET('Z30583.REX.DT') NEW SPACE(2,1) DSORG(PS) RECFM(F
)"                                                                              
FSUM7332 syntax error: got (, expecting Newline                                
       +++ RC(1) +++                                                            
     6 *-* "
LRECL(80) BLKSIZE(32720)"                                          
       >>>   "
LRECL(80) BLKSIZE(32720)"                                        
FSUM7332 syntax error: got (, expecting Newline                                
       +++ RC(1) +++                                                            
     7 *-* SAY "
DONE EXECUTING REXX SCRIPT"                                    
DONE EXECUTING REXX SCRIPT

_______________________________________________

Re: Running a REXX program from the z/OS shells

PostPosted: Mon Jan 07, 2019 8:08 pm
by willy jensen
ADDRESS TSO before the ALLOCATE made it work for me. Default ADDRESS in USS is SH. Also you should probably have either TRACKS or CYLS in the ALLOCATE command.

Re: Running a REXX program from the z/OS shells

PostPosted: Tue Jan 08, 2019 10:02 am
by steve-myers
I think the ALLOCATE command was not continued correctly. See Chapter 2 Rexx General Concepts / Structure and General Syntax / Continuations in TSO/E REXX Reference.