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.
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.