Learning SAS? Welcome to the exclusive online community for all SAS learners.

Need help with libname statement

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Need help with libname statement

Hi everyone,

I've been having some trouble assigning libnames in SAS University addition and was wondering if anyone else has had a similar problem or knows of a solution? I've attached a screenshot below.

Thanks in advance

LibnameTrouble.png


LibnameTrouble.png

Accepted Solutions
Solution
‎06-30-2014 04:57 PM
Super User
Super User
Posts: 6,502

Re: Need help with libname statement

In that case you want a FILENAME statement instead of a LIBNAME statement.

For example:

FILENAME SOURCE '/folders/myfolders/source.csv';

...

data mydata ;

  infile source dsd firstobs=2 ;

  input .....

View solution in original post


All Replies
Super User
Posts: 17,963

Re: Need help with libname statement

Libnames are usually meant to link to folder, though they can link to files as well. I've never used it to connect to a CSV though.

What are you trying to do?

New Contributor
Posts: 3

Re: Need help with libname statement

I'm trying to assign the library name 'sample' to make it easier to reference the csv file shown in other code that I am writing but I can't seem to get the libname to work.

Solution
‎06-30-2014 04:57 PM
Super User
Super User
Posts: 6,502

Re: Need help with libname statement

In that case you want a FILENAME statement instead of a LIBNAME statement.

For example:

FILENAME SOURCE '/folders/myfolders/source.csv';

...

data mydata ;

  infile source dsd firstobs=2 ;

  input .....

New Contributor
Posts: 3

Re: Need help with libname statement

Hi Tom

This seems to work. Thanks!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 388 views
  • 1 like
  • 3 in conversation