Allocating a file using REXX



IBM's Command List programming language & Restructured Extended Executor

Allocating a file using REXX

Postby sankar.guna » Mon Feb 09, 2009 10:35 am

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.
sankar.guna
 
Posts: 11
Joined: Wed Apr 02, 2008 5:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Allocating a file using REXX

Postby MrSpock » Mon Feb 09, 2009 5:05 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Allocating a file using REXX

Postby sankar.guna » Mon Feb 09, 2009 5:37 pm

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
sankar.guna
 
Posts: 11
Joined: Wed Apr 02, 2008 5:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Allocating a file using REXX

Postby sankar.guna » Mon Feb 09, 2009 6:25 pm

Thanks a lot;
i figured it myself. i moved " ' " before and after the pds names. and it worked
sankar.guna
 
Posts: 11
Joined: Wed Apr 02, 2008 5:05 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post