Page 1 of 1

Allocating a file using REXX

PostPosted: Mon Feb 09, 2009 10:35 am
by sankar.guna
Hi All,
I use the following code for one of my rexx program.
address tso,
"ALLOC FILE("ddnvar") SHR REUSE DS(pds)"
end.

i move 'test.srclib' to the dataname 'pds'. But its automatically allocates my userid to the dataname and 'pds' becomes userid.test.srclib.
Is there a way to avoid this ?

Many thanks
Sankar.

Re: Allocating a file using REXX

PostPosted: Mon Feb 09, 2009 5:05 pm
by MrSpock
Keep the quotes.

"ALLOC FILE("ddnvar") SHR REUSE DS(test.srclib)" will become 'userid.test.srclib'.

"ALLOC FILE("ddnvar") SHR REUSE DS('test.srclib')" will keep it as 'test.srclib'.

The first is an example of a non-qualified dataset.
The second is an example of a qualified dataset.

Re: Allocating a file using REXX

PostPosted: Mon Feb 09, 2009 5:37 pm
by sankar.guna
Thanks for your help Mrspock,
but the dataset name changes in the program,the value 'test.srclib' is not a constant.

i am moving the value 'test.srclib' to the dataname 'pds' dynamically in the program and the value changes depending upon the dataset names which the program uses.
-------------------------------------------------------------------
Pds gets the value 'test.srclib' or 'something else' in the previous step and after executing the following step
address tso,
"ALLOC FILE("ddnvar") SHR REUSE DS("pds")"

the value of Pds becomes 'userid.test.srclib'
------------------------------------------------------------------
Please advise

Thanks
Sankar

Re: Allocating a file using REXX

PostPosted: Mon Feb 09, 2009 6:25 pm
by sankar.guna
Thanks a lot;
i figured it myself. i moved " ' " before and after the pds names. and it worked