BookmarkSubscribeRSS Feed
arnreddy007
Calcite | Level 5

SAS considering numeric coloumns with missing values as characters while I am doing import with proc import I have tried both in Base SAS and SAS EG, is there a way around? 

1 REPLY 1
ballardw
Super User

@arnreddy007 wrote:

SAS considering numeric coloumns with missing values as characters while I am doing import with proc import I have tried both in Base SAS and SAS EG, is there a way around? 


Show the code, or the code generated if using a wizard. File type has some bearing, import options depending on file type such as GUESSINGROWS can make a difference.

 

If the "column" ends up with a $1. format, character of length 1, then the import procedure saw missing values for all of the rows used to GUESS which type of variable should be in the variable.

 

If the file was something like a spreadsheet you may have better luck doing a File>Save As to CSV format before attempting Proc import. Set the value for the number of rows to guess in the wizard to something 'large', where large ideally is the number of rows in the file but a value in the 1000's usually works for much larger files.

 

Note that Proc Import always guesses and depending on the individual file can generate different data types and lengths of character variables from two files that supposedly have the same file layout. Which often causes problems when the resulting data sets are combined.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 490 views
  • 0 likes
  • 2 in conversation