View previous topic :: View next topic
|
Author |
Message |
rajat_gupta
New User
Joined: 05 Apr 2007 Posts: 15 Location: india
|
|
|
|
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 |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
I am not very familiar with REXX but try freeing the DSNVAR before creating the new one |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Perhaps another job has the file DISP=OLD |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I suspect that if you are trying to copy the dataset, you need 2 different names. . . . |
|
Back to top |
|
|
jz1b0c
Active User
Joined: 25 Jan 2004 Posts: 160 Location: Toronto, Canada
|
|
|
|
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 |
|
|
|