DATA Step, Macro, Functions and more

Regarding import of a mixed data from excel

Reply
Contributor
Posts: 38

Regarding import of a mixed data from excel

Hello everyone,

 

I am importing a csv file in sas and one of the observations include data like Datsun_715

when i am importing such mixed data in sas it is only reading Datsun_

and that 715  is not getting read.

what to do? please suggest?

Super User
Posts: 6,972

Re: Regarding import of a mixed data from excel

Most probably the variable is defined with too short length.

If you used proc import, copy the data step from the log and adapt it.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 38

Re: Regarding import of a mixed data from excel

what if i redefine the length of the corresponding variable?

Super User
Posts: 17,963

Re: Regarding import of a mixed data from excel


atulsingh wrote:

what if i redefine the length of the corresponding variable?


If the variable has already been read incorrectly changing the length won't change the underlying value. 

 

Another fix for an 'incorrect' import from CSV Is to make the GUESSINGROWS option big - as large a the file. This means it scans the entire column before deciding on a length and format. 

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