Problem Note 64602: PROC EXPORT drops variables specified in the WHERE= data set option even though those variables are not specified in the DROP= data set option
The EXPORT procedure drops the variables that are specified in the WHERE= data set option even though the variables are not specified in the DROP= data set option.
Here is an example of code that can cause this issue. The expectation is that the HEIGHT variable is dropped and that the SEX and AGE variables appear in the file. However, the SEX and AGE variables are dropped along with HEIGHT, and only the NAME and WEIGHT variables are written to the class.csv file:
proc export data=sashelp.class(drop=height where=(sex='F' and age=15))
outfile='c:\temp\class.csv' dbms=csv replace;
run;
The workaround is to use one of the data set options, WHERE= or DROP=, in a DATA step prior to PROC EXPORT. Then use PROC EXPORT with the other option, WHERE= or DROP= , to create an external file.
In the following example, the WHERE= data set option is used in the DATA step and the DROP= data set option is used with PROC EXPORT:
data class;
set sashelp.class (where=(sex='F' and age=15));
run;
proc export data=class(drop=height)
outfile='c:\temp\class.csv' dbms=csv replace;
run;
Operating System and Release Information
SAS System | Base SAS | Solaris for x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Linux for x64 | 9.4 TS1M3 | 9.4 TS1M7 |
64-bit Enabled AIX | 9.4 TS1M3 | 9.4 TS1M7 |
Windows 7 Ultimate x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Windows 7 Ultimate 32 bit | 9.4 TS1M3 | 9.4 TS1M7 |
Windows 7 Professional x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Windows 7 Professional 32 bit | 9.4 TS1M3 | 9.4 TS1M7 |
Windows 7 Home Premium x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Windows 7 Home Premium 32 bit | 9.4 TS1M3 | 9.4 TS1M7 |
Windows 7 Enterprise x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Windows 7 Enterprise 32 bit | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows Server 2012 Std | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M3 | |
Microsoft Windows Server 2008 R2 | 9.4 TS1M3 | |
Microsoft Windows Server 2008 | 9.4 TS1M3 | |
Microsoft Windows 10 | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows 8 Pro x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M3 | 9.4 TS1M7 |
HP-UX IPF | 9.4 TS1M3 | 9.4 TS1M7 |
64-bit Enabled Solaris | 9.4 TS1M3 | 9.4 TS1M7 |
Microsoft® Windows® for x64 | 9.4 TS1M3 | 9.4 TS1M7 |
*
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.
Type: | Problem Note |
Priority: | high |
Topic: | SAS Reference ==> Procedures ==> EXPORT Common Programming Tasks ==> Reading and Writing External Data ==> with PROC EXPORT
|
Date Modified: | 2019-08-16 11:23:39 |
Date Created: | 2019-08-12 14:34:08 |