Problem Note 58662: Decimals are truncated to 4 digits when they are exported to dBase files using the DBF engine
When dBase variables are exported to dBase files, they might be truncated to 4 digits. The following example replicates the problem:
data temp1;
input mydata;
datalines;
1.11111111
2.22222222
3.33333333
;
proc export data=temp1 outfile='c:\sastest\mystuff.dbf' dbms=dbf;
run;
proc import datafile='c:\sastest\mystuff.dbf' out=sasdata dbms=dbf;
run;
proc print data=sasdata;
run;
The problem occurs because the DBF driver requires a format for the variable before exporting.
Workaround
To circumvent the problem, apply a format to the variable as shown below:
data temp1;
input mydata;
format mydata 18.7;
datalines;
1.11111111
2.22222222
3.33333333
;
Operating System and Release Information
| SAS System | SAS/ACCESS Interface to PC Files | Linux for x64 | 9.4 | | 9.4 TS1M0 | |
| Solaris for x64 | 9.4 | | 9.4 TS1M0 | |
| HP-UX IPF | 9.4 | | 9.4 TS1M0 | |
| 64-bit Enabled Solaris | 9.4 | | 9.4 TS1M0 | |
| 64-bit Enabled AIX | 9.4 | | 9.4 TS1M0 | |
| Windows 7 Professional x64 | 9.4 | | 9.4 TS1M0 | |
| Windows 7 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows Server 2012 Std | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows Server 2012 R2 Std | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows Server 2012 R2 Datacenter | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows Server 2012 Datacenter | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows Server 2008 for x64 | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows Server 2008 R2 | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows 10 | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows 8.1 Pro x64 | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows 8.1 Pro 32-bit | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows 8.1 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows 8.1 Enterprise 32-bit | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows 8 Pro x64 | 9.4 | | 9.4 TS1M0 | |
| Microsoft Windows 8 Enterprise x64 | 9.4 | | 9.4 TS1M0 | |
| Microsoft® Windows® for x64 | 9.4 | | 9.4 TS1M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Decimals might become truncated to 4 digits when they are exported to the DBF engine. To circumvent the problem, you must apply a format to the variable before exporting.
| Type: | Problem Note |
| Priority: | high |
| Date Modified: | 2016-08-04 11:33:45 |
| Date Created: | 2016-07-22 08:41:47 |