BookmarkSubscribeRSS Feed
ncross
Calcite | Level 5

Hi when i import a large file to SAS it replaces some of the variables with 1,2 , 3, etc. upto 9. I would like the original vaues ie: 1222, 6335, 3245 to remain as they are.

How do I ensure the SAS does not alter my variables?

The current command I am using is:

PROC IMPORT OUT= WORK.accounting          

DATAFILE= "C:\Users\253507F\Desktop\accvariables.csv"           

DBMS=CSV REPLACE;     GETNAMES=YES;     DATAROW=2; RUN;

5 REPLIES 5
spraynardz90
Calcite | Level 5

I have experienced a similar problem when uploading CSV files! Very interested to hear problems to solve for this

Ksharp
Super User

I don't understand what you mean ?

I notice you used DBMS=CSV ,that means SAS will take comma as a delimiter , and data 1222, 6335, 3245 contains comma , Maybe SAS take it as a delimiter .

So try to use DBMS=dlm ;   delimiter='your-delimiter' ;

Ksharp

ncross
Calcite | Level 5
ratioratio after import
0.0000180621
-0.0000158752
0.0000043383
-0.000132
0.0003161
-0.0000056841
-0.0001732
-0.000060281

This is what I mean. The actual values are translated into digits between 1-9.

I used DBMS=dlm ;   delimiter='your-delimiter' ; and this does not provide me with my table. Rather than having 18 rows by 23 columns, my table 2 columns with many rows via your method.

Ksharp
Super User

It is hard to say something.

Can you post some sample file of yours . I can test it whether it is right.

ballardw
Super User

When you run your example IMPORT code there should be datastep code in the log. If you would provide that we can probably provide better help. I suspect that the culprit will turn out to be the default GUESSINGROWS value of 20. If the first 20 rows have values that are integers the import procedure will assume the others are.

Try adding guesssingrows=32767 (this is the largest number of rows SAS will examine for CSV to determine range and types of values)

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1049 views
  • 1 like
  • 4 in conversation