Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: getting FILE IN USE error while creating a new DS in REXX
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    Post subject:
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: 8593
Location: Back in jolly old England

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

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

Site Director


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

PostPosted: Mon Apr 09, 2007 11:40 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us