SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sarah-R
Obsidian | Level 7

Hi,

 

When I use the libname statement with elipses (..) it does not work.

This is the code I used:

libname raw "../raw";

I get the following result:

NOTE: Library RAW does not exist.

 

 

When I use the full path, it does create the library.  I used the code:

libname raw2 "C:/Users/jessica/Desktop/project1/subproject2/raw";

I get result:

NOTE: Libref RAW2 was successfully assigned as follows:

Engine: V9

Physical Name:

 

Any support would be appreciated.  Let us hope this is solvable!

1 ACCEPTED SOLUTION

Accepted Solutions
6 REPLIES 6
CarmineVerrell
SAS Employee

You need to have only one period not two.

CarmineVerrell
SAS Employee
libname raw "./raw";
Sarah-R
Obsidian | Level 7

Thank you, Carmine. 

Does it sometimes work with two (..), and sometimes work with one (.)?  Or should it only work with one (.)?

CarmineVerrell
SAS Employee

Using one period is a programming trick to make it easier to point to the default directory within the libname statement. You can only use one period not two. If you change the default directory then your code won't work anymore so it a better programming practice to have the entire path in the libname statement. 

 

CarmineVerrell_0-1620931593796.png

 

Sarah-R
Obsidian | Level 7

I cannot believe that was it!  I would never have got it on my own.  Thank you.

Sarah-R
Obsidian | Level 7
Great illustration.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1450 views
  • 2 likes
  • 2 in conversation