Discussion:
How to Programatically deassign a Libname
(too old to reply)
SAS_learner
2009-01-13 13:53:49 UTC
Permalink
hello guys,

Right now I am chaniging my programs to work on Windows that are written on
Unix. As part of of it I am using same Libnames with the change of path and
syntax. Here I want to know if there is way to deassign all the libnames
that are assigned before say for example I have Libname Temp "C;\temp" to
Temp"D:\Temp\Sas" . I know SAS would pick up the second one as path but just
want to make sure that it does not take the First one.

And any of you have any macro or code which work on windows that would pick
the Folder name and assign the necessary libnames irrespective of what
Operating system I am using ??

TIA
SL
s***@yahoo.com
2009-01-13 16:47:08 UTC
Permalink
libname _all_;

See the log below.
HTH


525 libname s 'c:\temp';
NOTE: Libref S was successfully assigned as follows:
Engine: V9
Physical Name: c:\temp
526 libname s2 'c:\temp\temp';
NOTE: Libref S2 was successfully assigned as follows:
Engine: V9
Physical Name: c:\temp\temp
527
528 libname _all_;
NOTE: Libref S has been deassigned.
NOTE: Libref S2 has been deassigned.
Post by SAS_learner
hello guys,
Right now I am chaniging my programs to work on Windows that are written on
Unix. As part of of it I am using same Libnames with the change of path and
syntax. Here I want to know if there is way to deassign all the libnames
that are assigned before say for example I have Libname Temp "C;\temp" to
Temp"D:\Temp\Sas" . I know SAS would pick up the second one as path but just
want to make sure that it does not take the First one.
And any of you have any macro or code which work on windows that would pick
the Folder name and assign the necessary libnames irrespective of what
Operating system I am using ??
TIA
SL
Joe Matise
2009-01-13 17:20:02 UTC
Permalink
I could imagine a setup where you wanted to set up some libnames based on a
root folder, perhaps even the SAME root folder.

\\nas01\jobdir\subdir1\subdir2\ (WIN)
==
//nas01/jobdir/subdir1/subdir2 (UNIX)

or perhaps \\nas01\jobdir\ is mapped to m:\ on a particular computer.

You could find out what the location of the work directory is, I don't
recall the exact syntax but it is a system macro variable of some sort, and
from that determine something about the filesystem and OS I imagine.

-Joe

On Tue, Jan 13, 2009 at 11:07 AM, Gerhard Hellriegel <
That one of the rare points, which does NOT work independently of the OS!
The physical structure and syntax of the libraries are very different
between nearly any OS. On zOS it is a sequential file, on VM/CMS it is a
mini-disc, in UNIX and windows you have subdirectories, in win with the
disk letter as prefix (C:\...), in UNIX without. One little help: you can
use in SAS / or \, independant of the OS.
If you stay under one, let's say win, you will hardly find two machines
with the same hierarchy of subdirs, or even with the same disk-letters! So
how will you write a kind of "universal-libname-assigner"? I think, that
is not possible and makes no sense to try.
Gerhard
I believe
libname _all_ clear ;
will do what you want.
HTH,
-Roy
-----Original Message-----
SAS_learner
Sent: Tuesday, January 13, 2009 5:54 AM
Subject: How to Programatically deassign a Libname
hello guys,
Right now I am chaniging my programs to work on Windows that are written
on Unix. As part of of it I am using same Libnames with the change of path
and syntax. Here I want to know if there is way to deassign all the
libnames that are assigned before say for example I have Libname
Temp "C;\temp" to Temp"D:\Temp\Sas" . I know SAS would pick up the second
one as path but just want to make sure that it does not take the First one.
And any of you have any macro or code which work on windows that would
pick the Folder name and assign the necessary libnames irrespective of
what Operating system I am using ??
TIA
SL
Pardee, Roy
2009-01-13 16:53:48 UTC
Permalink
I believe

libname _all_ clear ;

will do what you want.

HTH,

-Roy

-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of SAS_learner
Sent: Tuesday, January 13, 2009 5:54 AM
To: SAS-***@LISTSERV.UGA.EDU
Subject: How to Programatically deassign a Libname

hello guys,

Right now I am chaniging my programs to work on Windows that are written on Unix. As part of of it I am using same Libnames with the change of path and syntax. Here I want to know if there is way to deassign all the libnames that are assigned before say for example I have Libname Temp "C;\temp" to Temp"D:\Temp\Sas" . I know SAS would pick up the second one as path but just want to make sure that it does not take the First one.

And any of you have any macro or code which work on windows that would pick the Folder name and assign the necessary libnames irrespective of what Operating system I am using ??

TIA
SL
Gerhard Hellriegel
2009-01-13 17:07:26 UTC
Permalink
That one of the rare points, which does NOT work independently of the OS!
The physical structure and syntax of the libraries are very different
between nearly any OS. On zOS it is a sequential file, on VM/CMS it is a
mini-disc, in UNIX and windows you have subdirectories, in win with the
disk letter as prefix (C:\...), in UNIX without. One little help: you can
use in SAS / or \, independant of the OS.
If you stay under one, let's say win, you will hardly find two machines
with the same hierarchy of subdirs, or even with the same disk-letters! So
how will you write a kind of "universal-libname-assigner"? I think, that
is not possible and makes no sense to try.
Gerhard
I believe
libname _all_ clear ;
will do what you want.
HTH,
-Roy
-----Original Message-----
SAS_learner
Sent: Tuesday, January 13, 2009 5:54 AM
Subject: How to Programatically deassign a Libname
hello guys,
Right now I am chaniging my programs to work on Windows that are written
on Unix. As part of of it I am using same Libnames with the change of path
and syntax. Here I want to know if there is way to deassign all the
libnames that are assigned before say for example I have Libname
Temp "C;\temp" to Temp"D:\Temp\Sas" . I know SAS would pick up the second
one as path but just want to make sure that it does not take the First one.
And any of you have any macro or code which work on windows that would
pick the Folder name and assign the necessary libnames irrespective of
what Operating system I am using ??
TIA
SL
Loading...