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】
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.
What do you mean by "truncated"?
Missing observations, or missing data at the end of single observations?
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.
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.
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.
Ready to level-up your skills? Choose your own adventure.