Hello,
I will be running a server task to automatically access and update population data in our main workfile using an Eviews-program. However, the department that gave us this data has only given us .dat-files made by SAS. The server does not have SAS installed, and I would prefer it to remain that way.
Using Python's Pandas, one could simply write: "pd.read_csv('path/to/file.dat', delimiter='\t')" to read most .dat-files. Is there an equally elegant solution for Eviews?
Or could you suggest an alternative?
Importing/open .dat-files from SAS
Moderators: EViews Gareth, EViews Moderator
-
- EViews Developer
- Posts: 765
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: Importing/open .dat-files from SAS
While we don't have support for SAS Dat files explicitly, it seems from your Python example that the SAS DAT file is a simple text file that uses tabs as the delimiter. If this is the case, then EViews should be able to read their text files.
After launching EViews, drag the DAT file to the EViews window and follow the Import wizard to see if EViews can read in the file correctly. After a successful import, look at the Capture window for the exact IMPORT command that was generated by the Import wizard so you can repeat the process as a single command.
Here's a code example of reading a simple text file using TAB as the delimiter (no date column):
After launching EViews, drag the DAT file to the EViews window and follow the Import wizard to see if EViews can read in the file correctly. After a successful import, look at the Capture window for the exact IMPORT command that was generated by the Import wizard so you can repeat the process as a single command.
Here's a code example of reading a simple text file using TAB as the delimiter (no date column):
Code: Select all
import C:\path\to\sas.dat ftype=ascii rectype=crlf skip=0 fieldtype=delimited delim=tab @smpl @all
Return to “General Information and Tips and Tricks”
Who is online
Users browsing this forum: No registered users and 2 guests