DATA Step, Macro, Functions and more

opening .dat files in sas university edition

Accepted Solution Solved
Reply
Contributor rk7
Contributor
Posts: 28
Accepted Solution

opening .dat files in sas university edition

Hi

I tried to open a .dat file in order to see the contents/data in the file. I stored the file in a shared location and try to open it in the browser. It din't open , moreover it was downloaded. can u pls help me in opening the opening the file to see what data we have in that file.

Thank you

 

P.S. attached the .dat file


Accepted Solutions
Solution
‎12-03-2017 08:46 AM
Valued Guide
Posts: 561

Re: opening .dat files in sas university edition

The reason the file was downloaded and not opened is that a .DAT file isn't a SAS file. In fact .DAT is an extension used for many different types of files which can sometimes only be opened by the application that created them. You might, however, be in luck if the .DAT files you want to read are text based delimited files like CSVs. Try opening them in a text editor to check out the format and if it's a plain text delimited file try Proc Import.

View solution in original post


All Replies
Solution
‎12-03-2017 08:46 AM
Valued Guide
Posts: 561

Re: opening .dat files in sas university edition

The reason the file was downloaded and not opened is that a .DAT file isn't a SAS file. In fact .DAT is an extension used for many different types of files which can sometimes only be opened by the application that created them. You might, however, be in luck if the .DAT files you want to read are text based delimited files like CSVs. Try opening them in a text editor to check out the format and if it's a plain text delimited file try Proc Import.

Contributor rk7
Contributor
Posts: 28

Re: opening .dat files in sas university edition

Posted in reply to ChrisBrooks

Thanks can u explain more about proc import

Valued Guide
Posts: 561

Re: opening .dat files in sas university edition

Proc Import is a SAS supplied routine you can use to convert many different file types into SAS Data Sets - you can find the documentation here -> http://documentation.sas.com/?docsetId=acpcref&docsetTarget=p0mqdq52ktqgjjn1vseqoiuyt3v1.htm&docsetV... and numerous online examples via a Google Search.

Contributor rk7
Contributor
Posts: 28

Re: opening .dat files in sas university edition

Posted in reply to ChrisBrooks
Thank you
Super User
Posts: 9,611

Re: opening .dat files in sas university edition

Anytime you encounter a SAS problem, do a (google) search for "sas text_of_your_problem". This works well with statements, functions, formats, procedures, but also ERROR or WARNING messages.

See Maxim 6.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor rk7
Contributor
Posts: 28

Re: opening .dat files in sas university edition

Posted in reply to KurtBremser

Thanks

☑ This topic is solved.

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

Discussion stats
  • 6 replies
  • 318 views
  • 1 like
  • 3 in conversation