BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rbolanos
Calcite | Level 5

I was given three data sets in .data format. Is it possible to import these into SS without converting them first? 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Excel will probably transform the data. Better to just write a simple data step to dump a few records to the log.

data _null_;
  infile 'myfile.data' obs=5 ;
  input;
  list;
run;

View solution in original post

4 REPLIES 4
ballardw
Super User

Are these files text or some sort of binary format?

 

If could post a few rows of the data in a code box opened using the forum's {i} menu icon we may be able to provide examples of what ot look for in the way of options.

 

If the data is in a proprietary data format such as some program uses it may be tricky but many text based file formats aren't much of an issue.

rbolanos
Calcite | Level 5

I believe its text. When I open it in a newer version of excel it gives me the options of creating spaces between the data and when you do that it looks like this:

 

excel.png

Tom
Super User Tom
Super User

Excel will probably transform the data. Better to just write a simple data step to dump a few records to the log.

data _null_;
  infile 'myfile.data' obs=5 ;
  input;
  list;
run;
ballardw
Super User

If you had to indicate where to break the values the data might be fixed column, in which case if you have a description document for the file SAS can read it fairly easily.

Or possibly delimited with tab, comma or similar character separating the values, which SAS cal also.

 

I would be very careful letting Excel hand a file as under a number of cases the value of cells saved in Excel can be different than intended.

I have seen Excel turn account numbers such as 123-456 into either arithmetic results or dates depending on the values of the numbers.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 904 views
  • 0 likes
  • 3 in conversation