- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Why does the file have a CSV extension?
If it is a CSV file, use the CSV engine:
dbms=csv
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The data file type should match the DBMS= request. Try DBMS=CSV.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
> 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have 1000 data in vfox
However when i export it to excel it only has 500 data in excel after i export it
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can you verify that the file is actually a dbf file? E.g. try to import it back to vfoxpro.