BookmarkSubscribeRSS Feed
ballardw
Super User

Proc Import should have created a datastep program visible in the Log. Copy that to the editor and modify to you hearts content, especially the informats.

 

Of course if your example file doesn't contain something the length of the longest value that will ever appear (specification document!!) then there can be issues with reusing the code.

FreelanceReinh
Jade | Level 19

Indeed, for a quick look into a .csv file with SAS, the IMPORT procedure is convenient. It can also generate a code template for an import data step. But when used for production purposes, those convenient automatisms constitute a risk. From a QC point of view, a procedure statement called "GUESSINGROWS" should make the alarm bells ring.

 

Still, I am curious about the reason of those length discrepancies. If I were to track that down, I would reduce/increase the actual length of the affected string, in order to find out exactly where the discrepancies start. Then I would make other small modifications to the file, and so on.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 16 replies
  • 4416 views
  • 0 likes
  • 5 in conversation