BookmarkSubscribeRSS Feed
egwilliamson
Obsidian | Level 7

When importing a .csv file to SAS VA I notice that some files are cutting the category vales short. For example, "Ireland" is showing up as "Irel", but in very few of the files it is showing up in full length. Any suggestions on how to make sure it loads with full length every time?

3 REPLIES 3
ballardw
Super User

I suspect that this is related to how you are importing the data into SAS. If you are using Proc Import then the program guesses for each file what the characteristics should be. The program by default uses something like the first 20 rows to set the lengths of variables. If you are using proc import then as a minimum add the GUESSINGROWS option with a large value (it can be larger than the number of records in your data) something in the range of 20000 might work.

Better if you are reading multiple files with the same format is to create a Datastep program so you can have fixed characteristics for all of your variables. The good thing is that proc import generates a datastep and the log from your proc import step should have the base code. You can copy from the long and save as a program and just change the input file and output dataset. Set the length of you character variables (Informat will do) to the longest expected (I ususally add a few more characters to allow for "new" data values).

egwilliamson
Obsidian | Level 7

I am loading the data through the SAS VA web interface - what would be the solution for using this method of importing the data?

ballardw
Super User

I don't have VA so can't suggest any options but If the first line in the file has the longest values then that might work.

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1202 views
  • 0 likes
  • 2 in conversation