BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
InspectahDex
Obsidian | Level 7

I have an excel spreadsheet (.xlsx) that has a few fields that are supposed to be dates. Most cells are in a MM/DD/YYYY format but there are other cells that have the word "NULL".  When I do a PROC IMPORT, all of the fields come in as character variables and all of the date values are turned into random numbers like 34563. How can I import these date values as the values that they are using PROC IMPORT? Guessingrows doesn't work. 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

Change the Excel column type of the date columns to "Date" and see if that helps. Having non-missing dates in the first few rows may also help.

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

Change the Excel column type of the date columns to "Date" and see if that helps. Having non-missing dates in the first few rows may also help.

InspectahDex
Obsidian | Level 7
The solution wasn't exactly this but it led me on the right track: I replaced the word "NULL" from the excel spreadsheet and reran the SAS program. My date fields were then imported properly.
SASKiwi
PROC Star

OK. The typical I'll accept anything you type into a column problem with Excel. AFAIK you can't "lock" the type of column to only accept valid data for that type.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 833 views
  • 0 likes
  • 2 in conversation