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

I have 1 million rows of Excel data that I import with SAS. How can I tell if the data is not truncated?use 【import data】

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

How do you "import" the data?

 

If you use Proc Import you would have to manually look at long values in the data if you mean truncated variables.

 

By default Proc Import will only examine 20 lines or so of data before setting properties of variables. So if the longest values of your variables do not occur in the first 20 rows then you may have truncated data.

 

If you expect to use Proc Import with very large files I strongly suggest that you export the data from Excel to a CSV file using File>Save As. Then use the option Guessingrows=max; which is available with importing delimited text but not Excel file formats. The option makes the program run longer as it examines more rows of the data to set properties.

 

Or write a data step where YOU control the variable names and characteristics to read the CSV file. If you expect to read multiple files of the same structure the data step is about the only way to get the same characteristics for each file.

View solution in original post

2 REPLIES 2
ballardw
Super User

How do you "import" the data?

 

If you use Proc Import you would have to manually look at long values in the data if you mean truncated variables.

 

By default Proc Import will only examine 20 lines or so of data before setting properties of variables. So if the longest values of your variables do not occur in the first 20 rows then you may have truncated data.

 

If you expect to use Proc Import with very large files I strongly suggest that you export the data from Excel to a CSV file using File>Save As. Then use the option Guessingrows=max; which is available with importing delimited text but not Excel file formats. The option makes the program run longer as it examines more rows of the data to set properties.

 

Or write a data step where YOU control the variable names and characteristics to read the CSV file. If you expect to read multiple files of the same structure the data step is about the only way to get the same characteristics for each file.

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