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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.