BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kayla_Tan222
Calcite | Level 5

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

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.

View solution in original post

11 REPLIES 11
ChrisNZ
Tourmaline | Level 20

Why does the file have a CSV extension?

If it is a CSV file, use the CSV engine:

dbms=csv

 

PGStats
Opal | Level 21

The data file type should match the DBMS= request. Try DBMS=CSV.

PG
heffo
Pyrite | Level 9

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

 

Kayla_Tan222
Calcite | Level 5

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?

PGStats
Opal | Level 21

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.

PG
Kayla_Tan222
Calcite | Level 5

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.

ChrisNZ
Tourmaline | Level 20

> 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.

 

Kayla_Tan222
Calcite | Level 5
For ex:
I have 1000 data in vfox
However when i export it to excel it only has 500 data in excel after i export it

SASKiwi
PROC Star

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.

Kurt_Bremser
Super User

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.

heffo
Pyrite | Level 9

Can you verify that the file is actually a dbf file? E.g. try to import it back to vfoxpro. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 11 replies
  • 8507 views
  • 0 likes
  • 6 in conversation