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.
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!
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.