BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sathish_jammy
Lapis Lazuli | Level 10

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!

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

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.

ChrisNZ
Tourmaline | Level 20

I was going to write those exact same words. @Sathish_jammy Abide by these words.

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 507 views
  • 4 likes
  • 3 in conversation