BookmarkSubscribeRSS Feed
Antoine44
Fluorite | Level 6

Hi everyone,

 

I'm trying to import a CSV file in SAS via clicking on 'file' then 'import data' but once the file is in SAS it gives me a different value.

 

How can I import a CSV file and keep the same values? 

 

Thanks!

4 REPLIES 4
Kurt_Bremser
Super User

Write your own data step, and use that. With the automated helpers (either the import wizard of Enterprise Guide or proc import), changes in the data can (and will) cause unwanted changes in the structure.

If your original task runs a proc import, copy the data step code from the log, adapt (and simplify!) it is as needed, and use that in the future.

Kurt_Bremser
Super User

If values are imported wrongly, please supply example data from the csv file (use the [i] button for posting textual data), and tell us which column was incorrectly read.

Antoine44
Fluorite | Level 6
CSV file
RIC             Price         Volume
AEIS.O          14.07         1500

SAS file

RIC             Price         Volume
AEIS.O          1             2

Here's an example of what happens to an observation when I import the CSV file.

I don't use any particular code, I just use the import data function from the file menu 

 

Thanks for your help!

Kurt_Bremser
Super User

Please show the REAL content of the csv file. It should look something like this:

RIC,Price,Volume
AEIS.O,14.07,1500

NEVER (and I mean never as in "not even when hell has frozen over so hard that the brimstone is superconducting") inspect a csv file with Excel or similar, as you will only see what Excel thinks of the data. Use a proper text editing/viewing tool, like notepad++.

 

Which import wizard do you use? That of Base SAS, SAS Studio, or Enterprise Guide?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 508 views
  • 0 likes
  • 2 in conversation