From: Robin on 7 Mar 2006 22:42 %LET USERID=zzzzzzzzz; %LET PASSWORD=xxxxxxxx; OPTIONS COMAMID=tcp REMOTE=sna3; FILENAME rlink 'F:\MAIN\SUBDIR\sna3_without_prompt.scr'; SIGNON sna3; RSUBMIT; LIBNAME _sasdb '//sasdb/some/place/dev/database/'; ENDRSUBMIT; LIBNAME ONUNIX SERVER=sna3 SLIBREF=_SASDB; %let dsname=ONUNIX.names; %macro opends(name); %if %sysfunc(exist(&name)) %then %let dsid=%sysfunc(open(&name,i)); %else %put Data set &name does not exist.; %mend opends; %opends(&dsname); RSUBMIT; LIBNAME _sasdb clear; ENDRSUBMIT; LIBNAME ONUNIX clear; SIGNOFF sna3; ======= Every step of this code works fine until the SIGNOFF sna3. sna3 is the server name. I get the same error without the LIBNAME _sasdb clear. I have found a SAS reference to The "ERROR: Unable to clear or re-assign the library XXXXXX because it is still in use" however that error is stated to be fixed in version 8.2. I'm running SAS 9.13 in Windows XP and logging onto a UNIX server to get at the DATA on the UNIX box. The code works fine until the sign-off. No other code is running, this code is the only piece using the Libname ONUNIX. Any help appreciated greatly! Only the error part of the log is shown below. 237 LIBNAME ONUNIX SERVER=sna3 clear; ERROR: Unable to clear or re-assign the library ONUNIX because it is still in use. ERROR: Error in the LIBNAME statement. 238 SIGNOFF sna3; NOTE: Remote signoff from SNA3 commencing. ERROR: Unable to clear or re-assign the library ONUNIX because it is still in use. ERROR: Terminate all active procedures that are using libnames defined through the SAS/CONNECT server. ERROR: Remote signoff from SNA3 cancelled. Thanks, Rob
From: LouisBB on 8 Mar 2006 01:07 Dear Robin, This is because of your coding. You open a file with %let dsid=%sysfunc(open(&name,i)); and never close it again. Try closing the file with %let dsid=%sysfunc(close(&dsid)); Please mind that you use the value of &dsid that it got from the open to do the close. (dsid is the data set identifier, a numvric value) %macro opends(name); %if %sysfunc(exist(&name)) %then %do; %let dsid=%sysfunc(open(&name,i)); %let dsid=%sysfunc(close(&dsid)); %end; %else %put Data set &name does not exist.; %mend opends; LouisBB "Robin" <red-eagle9(a)rogers.com> wrote in message news:kLGdnWXL56Erz5PZnZ2dnUVZ_t6dnZ2d(a)giganews.com... > %LET USERID=zzzzzzzzz; > %LET PASSWORD=xxxxxxxx; > > OPTIONS COMAMID=tcp REMOTE=sna3; > FILENAME rlink 'F:\MAIN\SUBDIR\sna3_without_prompt.scr'; > SIGNON sna3; > > RSUBMIT; > LIBNAME _sasdb '//sasdb/some/place/dev/database/'; > ENDRSUBMIT; > > LIBNAME ONUNIX SERVER=sna3 SLIBREF=_SASDB; > %let dsname=ONUNIX.names; > %macro opends(name); > %if %sysfunc(exist(&name)) %then > %let dsid=%sysfunc(open(&name,i)); > %else %put Data set &name does not exist.; > %mend opends; > %opends(&dsname); > > RSUBMIT; > LIBNAME _sasdb clear; > ENDRSUBMIT; > > LIBNAME ONUNIX clear; > SIGNOFF sna3; > > ======= > Every step of this code works fine until the SIGNOFF sna3. sna3 is the > server > name. I get the same error without the LIBNAME _sasdb clear. I have found > a SAS > reference to The "ERROR: Unable to clear or re-assign the library XXXXXX > because it is still in use" however that error is stated to be fixed in > version > 8.2. I'm running SAS 9.13 in Windows XP and logging onto a UNIX server to > get > at the DATA on the UNIX box. The code works fine until the sign-off. No > other > code is running, this code is the only piece using the Libname ONUNIX. > Any help appreciated greatly! > > Only the error part of the log is shown below. > 237 LIBNAME ONUNIX SERVER=sna3 clear; > ERROR: Unable to clear or re-assign the library ONUNIX because it is still > in > use. ERROR: Error in the LIBNAME statement. > 238 SIGNOFF sna3; > NOTE: Remote signoff from SNA3 commencing. > ERROR: Unable to clear or re-assign the library ONUNIX because it is still > in > use. ERROR: Terminate all active procedures that are using libnames > defined > through the SAS/CONNECT server. > ERROR: Remote signoff from SNA3 cancelled. > > Thanks, Rob >
|
Pages: 1 Prev: A couple of quick PROC GPLOT questions Next: macro CALMAR |