BookmarkSubscribeRSS Feed
shailey
Obsidian | Level 7

Hi, I am trying to import a file that has a variable, var1, where the first 600 values are 1 and the next 200 values are character strings. (I know, it's annoying and weird, but the data come as they come). I set the excel workbook as a library with:


libname lib excel "<file-name>.xlsx";


data dat;

set lib."data$"n (dbSAStype = (var1 = "CHAR(200)") );

run;


What I am getting is that var1 is a character variable with 600 "1"s but the 200 character strings are empty, as if it were numeric and dumped the characters. Am I doing something wrong? Please help!


(p.s., I know I can resort the data, delete the 1s, etc. etc. I'm really trying to minimize the amount I manipulate the data in Excel, and the fact that this didn't work makes me realize that I don't understand, so I'm trying to.)


1 REPLY 1
andreas_lds
Jade | Level 19

MS Excel is not in the list of supported data sources, see SAS/ACCESS(R) 9.4 for Relational Databases: Reference, Sixth Edition for more details.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 690 views
  • 0 likes
  • 2 in conversation