IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to allocate file using rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
praveenmaga

New User


Joined: 27 Jun 2009
Posts: 6
Location: Bangalore

PostPosted: Tue Nov 10, 2009 2:19 am
Reply with quote

When I try to run my rexx thru online, the following message is populated.
"PBCL.LISTID.LIST1' file is already allocated. Please help me what i am doing syntex error.
INVALID DATA SET NAME, "PBCL.LIDID.LIST1"
MISSING DATA SET NAME OR *+
MISSING NAME OF DATA SET TO BE ALLOCATED
***
*********************************************
My rexx code:
/*******REXX**********/
'ALLOCATE DDN(HI) DSN("PBCL.LIDID.LIST1") SHR'
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Nov 10, 2009 2:21 am
Reply with quote

You have the quotation marks backwards. It should be:

/*******REXX**********/
"ALLOCATE DDN(HI) DSN('PBCL.LIDID.LIST1') SHR"
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Nov 10, 2009 2:22 am
Reply with quote

... and you should get yourself into the habit of always using REUSE

/*******REXX**********/
"ALLOCATE DDN(HI) DSN('PBCL.LIDID.LIST1') SHR REUSE"
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Nov 10, 2009 2:36 am
Reply with quote

and be sure to FREE dsn in your REXX script.

If your REXX script bombs before your script executes the FREE dsn statement,
you can do a command line TSO FREEE 'dsn' before you test your REXX script again.
Back to top
View user's profile Send private message
praveenmaga

New User


Joined: 27 Jun 2009
Posts: 6
Location: Bangalore

PostPosted: Tue Nov 10, 2009 2:59 am
Reply with quote

thnx..its working fine now.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Nov 10, 2009 12:47 pm
Reply with quote

Easy enough to duplicate one line that frees all of the files used in a REXX, one copy at the start, one at the end.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top