BookmarkSubscribeRSS Feed
Dil
Calcite | Level 5 Dil
Calcite | Level 5

Hi all,

I previously had a problem when I used proc import to import a csv file into SAS EG (two of the numeric variables were detected for errors for some rows). But when I imported the csv file manually, it was fine. I was suggested by Xia Keshan that I could use guessingrows=32767 statement. When I tried the proc import with this statement, I didn't have any errors like before. However, just noticed that now all the numeric variables including sas date variables all became character variables. Any suggesion on resolving this issue? Thanks.

5 REPLIES 5
Ksharp
Super User

"just noticed that now all the numeric variables including sas date variables all became character variables"

That is beacuse these numeric variabls and date variables contains some characters  like TAB ......

You need to change them on your own, and no doubt you get some error in log, and use ??  or compress() to avoid the error info.

Xia Keshan

Dil
Calcite | Level 5 Dil
Calcite | Level 5

Thanks Xia keshan. Yes, you are right. Now I imported them on my own.

Just out of curiosity. Did you mean those variables might have ..... or actual word TAB? I guess .... right? I do see that those two variables have decimal points.

Ksharp
Super User

I don't know. But they do have some characters I believe.

If you use input() to convert them into numeric variable, You are going to get ERROR message in log window , I think.

Xia Keshan

jakarman
Barite | Level 11

You can read csv files excellent using a datastep. No need to go for guessing as you are knowing your data.

---->-- ja karman --<-----
GurmeetKaur_23
Calcite | Level 5

Hi There,

 

Can you give some small example on how can we read .csv files using datalines and without guessing rows and proc import?

 

It will be of great help.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 4142 views
  • 4 likes
  • 4 in conversation