Hi,
I have a CSV file with multiple columns. While converting the CSV file into a dataset using Proc import, Some values in random columns are getting shrink.
For instance:
In CSV file there is an ID 'TNGPM000023662'
After Import the data it has 'TNGPM00002366' (The last number is missed)
Likewise, some random columns read only the limited set of values in Proc Import.
Kindly suggest a best method to read all the data values.
Thanks in advance!
Hi @Sathish_jammy,
Use the GUESSINGROWS statement to increase the number of rows examined by PROC IMPORT to guess (!) the appropriate length (and type) of the variables, e.g.
guessingrows=max;
to be on the safe side.
Better still, write your own DATA step to read the CSV file and take control over all variable attributes -- based on the documentation of the record layout (which you hopefully have) rather than guesswork.
Hi @Sathish_jammy,
Use the GUESSINGROWS statement to increase the number of rows examined by PROC IMPORT to guess (!) the appropriate length (and type) of the variables, e.g.
guessingrows=max;
to be on the safe side.
Better still, write your own DATA step to read the CSV file and take control over all variable attributes -- based on the documentation of the record layout (which you hopefully have) rather than guesswork.
I was going to write those exact same words. @Sathish_jammy Abide by these words.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.
Ready to level-up your skills? Choose your own adventure.