Hi,
I want to import a dbf file which I created from vfoxpro into sas.
Here's my code below
proc import datafile = '\C:\Data\PL\DBF\PL.dbf'
out= pm.Plcm
REPLACE
dbms = dbf;
the system keep saying non-supported file is specified. How can I do with this problem?
Submit this - proc setinit; run; - to confirm if SAS/ACCESS Interface to PC Files is licensed or not and - proc product_status; run - to confirm if it is installed.
If this product is installed then reading DBF files should be possible.
Why does the file have a CSV extension?
If it is a CSV file, use the CSV engine:
dbms=csv
The data file type should match the DBMS= request. Try DBMS=CSV.
Is the file a CSV file or a dbf file? Your code indicates that it is a csv file. Verify what happens if you try to open the file in notepad or similar program.
I don't know but I found this text:
Note: | To import DBF files created with Microsoft Visual FoxPro, you must export to an appropriate dBASE format using Visual FoxPro. Import the dBASE file to SAS. |
http://support.sas.com/documentation/cdl/en/acpcref/63184/HTML/default/viewer.htm#a003102096.htm
Sorry, its a typo. the actual code is below with .dbf
proc import datafile = '\C:\Data\PL\DBF\PL.dbf'
out= pm.Plcm
REPLACE
dbms = dbf;
I unable to get the result. WHat wrong with this code?
SAS ability to import from DBF files is part of SAS/ACCESS, which requires a separate licence.
You could try importing the DBF into MS-Excel or MS-Access and exporting the data as a CSV. Importting from CSVs is included in Base SAS.
i have tried to export my dbf file to excel csv in vfoxpro, but then my records was too much, the excel only store some of the records but not all.
> my records was too much, the excel only store some of the records but not all.
This is unclear. There is no limit to the amount of data a CSV file can store. Even if Excel cannot read it all, it's there.
Submit this - proc setinit; run; - to confirm if SAS/ACCESS Interface to PC Files is licensed or not and - proc product_status; run - to confirm if it is installed.
If this product is installed then reading DBF files should be possible.
Creating csv files in MS Visual Foxpro is very simple:
USE some.dbf COPY TO some.csv TYPE CSV
(taken from https://social.msdn.microsoft.com/Forums/en-US/9e68b095-83f5-40d4-a764-d1d1dd8ff140/convert-foxpro-t...)
Then you just inspect the file with a proper editor (eg notepad++) to see the structure and content. From that, write the necessary data step. No license beyond Base needed.
Can you verify that the file is actually a dbf file? E.g. try to import it back to vfoxpro.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.