DATA Step, Macro, Functions and more

Date value missing in raw data

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Date value missing in raw data

[ Edited ]

I am trying to import data from an excel file with the following format which as some date values missing. can you say how SAS will interpret these missing date values and display them. and is there any other ways to import this file. using university SAS studio.

 

Name Salary Date of joining

Rob 25680 12/02/2012

Steve 35875 5/17/2010

John 26990    

Joe 39995 2/22/2006

 

 

Thanks


Accepted Solutions
Solution
‎01-31-2017 10:30 AM
Super User
Posts: 10,521

Re: Date value missing in raw data

There should be a task to import data. If it has XLSX or XLS as a file type to import should be able to import.

 

SAS will set your blank values to missing. This will most likely appear as period when you look at tables. If you get blanks instead then something inhibited SAS from setting the proper date valued numeric variable type. This could happen if the first rows are all missing the value which would make SAS believe the variable is character.

 

If you do not see XLSX as an acceptable file type (meaning your license may not access to Excel) then save the file as CSV from Excel and import that file.

View solution in original post


All Replies
Frequent Contributor
Frequent Contributor
Posts: 89

Re: Date value missing in raw data

With the XLSX file of

Name Salary date_of_joining
Rob 25680 12/2/2012
Steve 35875 5/17/2010
John 26990  
Joe 39995 2/22/2006

 

I get a SAS file of

Name Salary date_of_joining
Rob 25680 2-Dec-12
Steve 35875 17-May-10
John 26990 .
Joe 39995 22-Feb-06
Solution
‎01-31-2017 10:30 AM
Super User
Posts: 10,521

Re: Date value missing in raw data

There should be a task to import data. If it has XLSX or XLS as a file type to import should be able to import.

 

SAS will set your blank values to missing. This will most likely appear as period when you look at tables. If you get blanks instead then something inhibited SAS from setting the proper date valued numeric variable type. This could happen if the first rows are all missing the value which would make SAS believe the variable is character.

 

If you do not see XLSX as an acceptable file type (meaning your license may not access to Excel) then save the file as CSV from Excel and import that file.

New Contributor
Posts: 2

Re: Date value missing in raw data

[ Edited ]

I was wondering how SAS interprets the missing data. Thanks for the clarification.

☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 151 views
  • 0 likes
  • 3 in conversation