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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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