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?
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).
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.