BookmarkSubscribeRSS Feed
BharathBandi
Calcite | Level 5

how to read a .dat file (data file) which i couldnt read as a text file???using

11 REPLIES 11
SASKiwi
PROC Star

ODBC is mostly used for reading database tables not data/text files. What does the .DAT file look like when viewed in a text editor? Does it have aligned rows and columns or is a delimiter used to separate columns?

What issues are you having reading it?

BharathBandi
Calcite | Level 5

It is not opening in text editor, when tried data is crashed.

I basically want to read a .dat file that is copied from exchequer database.

Thank you

SASKiwi
PROC Star

How big is the file? Most likely it is the file size that is causing the text editor problems.

You could try reading a few records in SAS to see what the record layout is by writing the first 5 records to the SAS log:

data test;

  infile "YourFileName.dat" obs = 5;

  input;

  put _infile_;

run;

BharathBandi
Calcite | Level 5

Files are quite small something around 100 KB.

These files are extracted from Pervasive DB which has a default extension .Dat. which cannot be opened in text editor.

The only way I can read this file is through ODBC connection.

BharathBandi
Calcite | Level 5

Thank you all . We need to buy Btrieve odbc drivers, it solves the problem. Smiley Happy

LinusH
Tourmaline | Level 20

If I recall it correctly, I think.dat was the default extension for export/backup-files in (very) old versions of SQL Server.

If this is such file, you can't import it either way (ODBC nor text file import).

Verify your source, before trying to import it.

Data never sleeps
BharathBandi
Calcite | Level 5

Yes it is default extension and these files are extracted from pervasive db.

LinusH
Tourmaline | Level 20

Don't think this is a SAS question. How you can be able to access this data via ODBC is a question for Actian/Pervasive DB.

Once you secured ODBC access to your source data, then you can go to SAS and try to connect.

Data never sleeps
SASKiwi
PROC Star

You will also need the SAS product SAS/ACCESS to ODBC both installed and licensed if you wish to extract ODBC data using SAS code.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 1616 views
  • 0 likes
  • 4 in conversation