SAS read-only datasets

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

SAS read-only datasets

Hello,

I have been trying to import a excel spreadsheet into sas that contains both characters and numbers. I figured out that you can use a libname statement to read in the excel spreadsheet as a sas file. You can add the "mixed=yes" option to the libname statement to read in both characters and numbers. I used the following code:

libname xlsstd "U:\johnsok\STD_HIV 2011.xls" mixed=yes;

Now the dataset is in SAS but it is only READ ONLY. This is the error that I get in my log:  ERROR: Write access to member XLSSTD.'all$'n.DATA is denied.

I'm not sure how to get around this and convert the dataset into a writable dataset so I can run some analyses. Any suggestions? Thanks in advance!

Kelly


Accepted Solutions
Solution
‎04-08-2013 05:18 PM
Super User
Posts: 17,899

Re: SAS read-only datasets

That code just created a link to the excel workbook, it did not import it.

Something like the following will import the dataset.

data all;

     set xlsstd.'all$'n;

run;

View solution in original post


All Replies
Solution
‎04-08-2013 05:18 PM
Super User
Posts: 17,899

Re: SAS read-only datasets

That code just created a link to the excel workbook, it did not import it.

Something like the following will import the dataset.

data all;

     set xlsstd.'all$'n;

run;

Occasional Contributor
Posts: 15

Re: SAS read-only datasets

It worked! Thanks so much!

Occasional Contributor
Posts: 15

Re: SAS read-only datasets

Ok it worked!

Now I am creating a table, by county, to have variables (health indicators) listed with their frequency, rate and rank using proc print. In the beginning, the characters (i.e. <4, this is how I need it to appear) remain with the number and character, <4, in the frequency column, but as soon as I run it in a macro or when I use proc print, the <4 disappears and it puts a "." as if the value is missing. Any suggestions as to how to keep the character and number together (<4).

Thanks in advance!

☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 220 views
  • 0 likes
  • 2 in conversation