Running a REXX program from the z/OS shells

IBM's Command List programming language & Restructured Extended Executor
BonganiMabuza
Posts: 2
Joined: Mon Jan 07, 2019 2:28 pm
Skillset: Beginner
Referer: Google

Running a REXX program from the z/OS shells

Postby BonganiMabuza » Mon Jan 07, 2019 3:19 pm

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):

Code: Select all

/*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
You do not have the required permissions to view the files attached to this post.

expat
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm

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

Postby expat » Mon Jan 07, 2019 3:35 pm

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

Code: Select all


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

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

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

Postby NicC » Mon Jan 07, 2019 4:30 pm

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?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

BonganiMabuza
Posts: 2
Joined: Mon Jan 07, 2019 2:28 pm
Skillset: Beginner
Referer: Google

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

Postby BonganiMabuza » Mon Jan 07, 2019 5:28 pm

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') :
_______________________________________________________

Code: Select all

    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

_______________________________________________

willy jensen
Posts: 474
Joined: Thu Mar 10, 2016 5:03 pm
Skillset: assembler rexx zOS ispf racf smf
Referer: saw it in the experts foprum thought I could help here

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

Postby willy jensen » Mon Jan 07, 2019 8:08 pm

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.

steve-myers
Global moderator
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Skillset: Assembler, JCL, utilities
Referer: zos.efglobe.com

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

Postby steve-myers » Tue Jan 08, 2019 10:02 am

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.


  • Similar Topics
    Replies
    Views
    Last post