SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Is it possible to import a .data file into SAS

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Is it possible to import a .data file into SAS

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

Thank you!


Accepted Solutions
Solution
‎06-14-2017 02:41 PM
Super User
Super User
Posts: 6,500

Re: Is it possible to import a .data file into SAS

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


All Replies
Super User
Posts: 10,500

Re: Is it possible to import a .data file into SAS

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.

New Contributor
Posts: 2

Re: Is it possible to import a .data file into SAS

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

Solution
‎06-14-2017 02:41 PM
Super User
Super User
Posts: 6,500

Re: Is it possible to import a .data file into SAS

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;
Super User
Posts: 10,500

Re: Is it possible to import a .data file into SAS

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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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