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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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