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

Unable to free the used file


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

New User


Joined: 28 Feb 2009
Posts: 3
Location: India

PostPosted: Tue Apr 27, 2010 10:23 am
Reply with quote

Am new to REXX/CLIST, begining with the following code to handle the files. Am facing the problem when executing this code for the second time. it says DATASET IN USE.

Here is my code:

ALLOCATE FILE(SALARIES) DA('<FILENAME>') SHR REU
OPENFILE SALARIES OUTPUT
SET SALARIES=XXYYZZ
PUTFILE SALARIES
END
FREE FILE('<FILENAME>')
CLOSFILE SALARIES

Experts assistance will help me.

Regards, Ruthran
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Apr 27, 2010 11:25 am
Reply with quote

I would take a good look at the FREE statement in the CLIST or TSO/E manual, easily reached from the sticky at the top of the CLIST & REXX forum

Even looking at your code gives a clue
Code:
 FREE FILE('data set name')

You specify that you want to free a FILE (DD Name) but specify a datatset name as the parameter. Maybe paying attention to the rules might help you.
Back to top
View user's profile Send private message
Ruthran

New User


Joined: 28 Feb 2009
Posts: 3
Location: India

PostPosted: Tue Apr 27, 2010 11:52 am
Reply with quote

Found the problem

Coded the "END" in middle of the code triggers this issue..

Thx for the assistance.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top