BookmarkSubscribeRSS Feed
Barkat
Pyrite | Level 9

I am having problem in importing the attached excel file. One of the date column is imported as character and number.

1 REPLY 1
ballardw
Super User

If you use Proc import or the wizard then SAS only exams 8 or so rows of the data to set properties. Because way too many people are not consistent about what they put into spreadsheets you get such behavior.

 

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Might consider saving the file to CSV from Excel, import the resulting CSV file and use the option available with delimited files to use a large value for the Guessingrows parameter so more rows of data are examined before setting properties.

Also, then  Proc import writes code to the log of how the file was read. The code could be copied from the log and edited to change the informat or other properties of the variables, including names and such, as needed.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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