Help using Base SAS procedures

what is $ sign inside this LIBNAME

Reply
New Contributor
Posts: 3

what is $ sign inside this LIBNAME

Hi,

I tried to find the meaning of $ sign inside the following quotes.

libname name '$CUSTOMER'

In my SAS class, I was taught physical location is specified inside the quotes.

I explored SAS documentation but could not get a clear understanding.

Could anyone of you help me?

Thanks

Mirisage

Regular Contributor
Posts: 184

Re: what is $ sign inside this LIBNAME

I think you've answered your own question. $CUSTOMER is the host OS (operating system) folder or directory name. I would not call it "physical" because it's pretty abstract vis a vis the hardware implementation of the OS filespace.

Only if your OS disallows dollar signs in file names is there a mystery.

Here's a Windows XP example.

options noxwait xsync ;

x cd c:\temp ;

x mkdir $CUSTOMER ;

libname name '$CUSTOMER' ;

data name.test ;

run ;

libname name clear ;

Fernando wrote:

Hi,

I tried to find the meaning of $ sign inside the following quotes.

libname name '$CUSTOMER'

In my SAS class, I was taught physical location is specified inside the quotes.

I explored SAS documentation but could not get a clear understanding.

Could anyone of you help me?

Thanks

Mirisage

PROC Star
Posts: 425

Re: what is $ sign inside this LIBNAME

Hi Fernando,

Is your SAS program running on a UNIX server?  If so then CUSTOMER may be an environment variable and $CUSTOMER will be replaced with its value, hopefully the path to a directory containing SAS tables.  For example on my server the following assigns a library to my home directory because HOME is a UNIX environment variable that points to my home directory /home/paul for example:

libname home '$HOME';

I also get to see what $HOME was in the SAS log's NOTE: message when the code is submitted.   Another way to determine the value of an environment variable is to use %sysget like so:

%put %sysget(CUSTOMER);

Cheers

Paul

Ask a Question
Discussion stats
  • 2 replies
  • 222 views
  • 0 likes
  • 3 in conversation