Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing a Dataset Using Symbolics

Status
Not open for further replies.

kjd2121

Programmer
Aug 13, 2010
3
US
Hi, New to the REXX language.

I am trying to write to a dataset using variables within the program. For each user that executes the program I want to create a new member in their personal PDS using their USER ID as the PDS name and the Julian date as the member name. The member will contain a set of report file names so they can reference once the job completes.

Here is what I am trying to do:

USER = USERID()

/* GET TODAYS JULIAN DATE AND TIME FOR THE OUTPUT FILE SUFFIXES */
DATEIN=DATE('S')
ABC=DATE('D',DATEIN,'S')
JDAT='J'||RIGHT(SUBSTR(DATEIN,1,4),4,'0')||RIGHT(ABC,3,'0')
ADDRESS TSO
"ALLOCATE MOD F(OUT) DATASET('&USER.DBH.REPORTS(&JDAT)') REUSE"
QUEUE "&FILE09"
QUEUE "&FILE10"
QUEUE "&FILE11"
"EXECIO * DISKW OUT (FINIS"
"FREE F(OUT)"

The symbolics used in the ALLOCATE stmt above are failing. Can you offer some suggestions? Thanks
 
I decided to do things a bit differently. I got it all working now.
 
make sure the symbolics are not within quotes. Within quotes they are just text.

Code:
"ALLOCATE MOD F(OUT) DATASET('"&USER".DBH.REPORTS("&JDAT)"') REUSE"


Nic
 
Thanks Nic.

I tried your code, but had to tweak it a bit. Here is th working version:

ALLOCATE MOD F(OUT) DATASET('"USER".DBH.REPORTS."JDAT"') REUSE

Don't need the &

Appreciate the response.
 
Guys, don't forget that DISP=MOD is NOT a supported dispostion for a PDS. If you really want to append information to an existing member, edit it and do an INSERT.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top