BookmarkSubscribeRSS Feed
yli33
Fluorite | Level 6

Hi, 

 

I have encountered a rather odd issue regarding attempting to view the SAS datasets in SAS 9.4 after creating a SAS library. Specifically, I do not see any of the SAS datasets within my first folder when I created a new library in SAS. In other words, I am only able to view the datasets located in the second folder upon assigning it to the same SAS library. Please find below an example of the SAS code that I have used to create the SAS library:

 

LIBNAME XXXXXX 'FIRST FOLDER PATHNAME';
options validvarname=any;
LIBNAME XXXXXX 'SECOND FOLDER PATHNAME';
options validvarname=any;
 
Therefore, I would greatly appreciate it if someone could provide a potential solution to this issue. Thanks in advance!
6 REPLIES 6
SuryaKiran
Meteorite | Level 14

What does the log say when you run your first libname, Is it assigned successfully? 

Thanks,
Suryakiran
yli33
Fluorite | Level 6

Hi Suryakiran,

 

So, I have just tried to run each SAS code separately instead of both codes simultaneously. When I ran the first set of SAS codes, I am able to see all of the SAS datasets from my first folder within the SAS library. However, when I ran the second set of SAS codes, the datasets from the second folder overrode those from the first folder. Perhaps I should create two different libraries? 

Kurt_Bremser
Super User

The second libname re-assigns the library definition; it does not append the second to the first. For that you need concatenated libraries.

Or you use two separate libraries.

yli33
Fluorite | Level 6

Hi,

 

Thank you so much for clarifying the root cause of my SAS issue. I have already concatenated the two folders into a single library and was able to view all datasets located in both folders. Thanks again!

yli33
Fluorite | Level 6

Hi, 

 

Thank you for suggesting the "sas concatenated library" as an alternative solution to the SAS issue. I will definitely google the specific details involved in this procedure.

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
  • 2047 views
  • 0 likes
  • 3 in conversation