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

getting FILE IN USE error while creating a new DS in REXX


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

New User


Joined: 05 Apr 2007
Posts: 15
Location: india

PostPosted: Mon Apr 09, 2007 12:26 pm
Reply with quote

Hi I am copying an existing DS attributes to create a new DS.
But it is showing file in use for the old one.

/* thru this i am getting the name of an existing DS
"ISPEXEC LMDINIT LISTID(DSLIST) LEVEL(&HLQ)"
"ISPEXEC LMDLIST LISTID(&DSLIST)",
"DATASET(DSNVAR) OPTION(LIST) STATS(YES)"
TEMP=DSNVAR

/* thru it i am copying those attributes to create a new DS
"ALLOC DA('"TEMP"') F(DATAIN) SHR REUSE"
"ALLOC DA('"NEWHLQ"') F(DATAOUT) LIKE('"TEMP"') NEW"


If anyone has an idea ,as to how solve this problem then pls help me ASAP.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Mon Apr 09, 2007 12:42 pm
Reply with quote

I am not very familiar with REXX but try freeing the DSNVAR before creating the new one
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Apr 09, 2007 1:07 pm
Reply with quote

Perhaps another job has the file DISP=OLD
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 09, 2007 11:40 pm
Reply with quote

Hello,

I suspect that if you are trying to copy the dataset, you need 2 different names. . . .
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Tue Apr 10, 2007 3:03 am
Reply with quote

TRY THE FOLLOWING BY replacing the datasets with your one


/* REXX */

HLQ = "JZ1B0C.JCLLIB"
"ISPEXEC LMDINIT LISTID(DSLIST) LEVEL(&HLQ)"
"ISPEXEC LMDLIST LISTID(&DSLIST)",
"DATASET(DSNVAR) OPTION(LIST) STATS(YES)"
"ISPEXEC LMDFREE LISTID(&DSLIST)"
TEMP=DSNVAR
say temp
NEWHLQ="JZ1B0C.JCLLIB.NEW"
"ALLOC DA('"TEMP"') F(DATAIN) SHR REUSE"
"ALLOC DA('"NEWHLQ"') F(DATAOUT) LIKE('"TEMP"') NEW"

EXIT
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top