CA OPS/MVS Event Management and Automation - Need help allocating a dataset in an OPS REXX program.
search cancel

CA OPS/MVS Event Management and Automation - Need help allocating a dataset in an OPS REXX program.

book

Article ID: 9322

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

Tried issuing an alloc command when I call a rexx program. But, it doesn't pick up the second line for lrecl and blocksize as seen in the code below. Do you have anything in the OPS samplib to use for an example or can you tell me how to concat the two lines? 

This code doesn't pick up line 2 ,  do I need a coma?
  DSN = "SSXXX.XXXXXXXX.TEST"                                    
"ALLOC F(PROCAB) NEW DSN(" || DSN || ") "                             
 "LRECL(80) RECFM(FB) UNIT=(3390) TRACKS SPACE (5,5) CATALOG "          
"FREE F(PROCAB)"                                                       
exit     
                                                             
This code below fails at run time  
  DSN = "SSXXX.XXXXXXXX.TEST"                                    
"ALLOC F(PROCAB) NEW DSN(" || DSN || ") ||                             
 LRECL(80) RECFM(FB) UNIT=(3390) TRACKS SPACE (5,5) CATALOG "          
"FREE F(PROCAB)"                                                       
exit

Environment

z/OS

Cause

The code was missing a comma, had an incorrect "=" in the UNIT keyword and had "F B" together in the RECFM keyword.

Resolution

Try this code:

DSN = "SSXXX.XXXXXXXX.TEST"
"ALLOC F(PROCAB) NEW DSN(" || DSN || ") ",
"LRECL(80) RECFM(F B) UNIT(3390) TRACKS SPACE (5,5) CATALOG "
DO QUEUED()
PULL LINE
SAY LINE
END
"FREE F(PROCAB)"
EXIT


Additional Information

It is a good practice to read the EDQ after TSO commands so that you can see the error messages that are being produced. See the code added the DO QUEUED() section to read and display the EDQ.