Running a REXX program from the z/OS shells



IBM's Command List programming language & Restructured Extended Executor

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

/*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.
BonganiMabuza
 
Posts: 2
Joined: Mon Jan 07, 2019 2:28 pm
Has thanked: 4 times
Been thanked: 0 time

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


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

These users thanked the author expat for the post:
BonganiMabuza (Mon Jan 07, 2019 5:29 pm)
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

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

These users thanked the author NicC for the post:
BonganiMabuza (Mon Jan 07, 2019 5:29 pm)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

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

_______________________________________________
BonganiMabuza
 
Posts: 2
Joined: Mon Jan 07, 2019 2:28 pm
Has thanked: 4 times
Been thanked: 0 time

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.

These users thanked the author willy jensen for the post:
BonganiMabuza (Wed Jan 09, 2019 12:06 pm)
willy jensen
 
Posts: 467
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 70 times

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.

These users thanked the author steve-myers for the post:
BonganiMabuza (Wed Jan 09, 2019 12:06 pm)
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post