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