Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

SAS VA Category Values Cut Short

Reply
New Contributor
Posts: 2

SAS VA Category Values Cut Short

[ Edited ]

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?

Grand Advisor
Posts: 10,196

Re: SAS VA Category Values Cut Short

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

New Contributor
Posts: 2

Re: SAS VA Category Values Cut Short

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

Grand Advisor
Posts: 10,196

Re: SAS VA Category Values Cut Short

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.

Ask a Question
Discussion stats
  • 3 replies
  • 251 views
  • 0 likes
  • 2 in conversation