Problem Note 64589: The EXPORT procedure does not write out all the variables listed for the KEEP= data set option when the RENAME= data set option is also included
PROC EXPORT does not write out all the variables listed for the KEEP= data set option when the RENAME= data set option is also used.
For example, three variables are listed for the KEEP= data set option, and one of the variables is renamed with the RENAME= data set option. The variable that is renamed using the RENAME= data set option is not written to the external file, but the other two variables are written to the file.
Here is an example of code that can cause this issue. In this case, only the NAME and AGE variables are written to the class.csv file:
proc export data=sashelp.class
(rename=(SEX=GENDER) keep= NAME SEX AGE)
outfile='c:\temp\class.csv' dbms=csv replace;
run;
The workaround is to use one of the data set options, RENAME= or KEEP=, in a DATA step prior to PROC EXPORT. Then use PROC EXPORT with the other option, RENAME= or KEEP= , to create an external file.
In the following example, the RENAME= data set option is used in the DATA step and the KEEP= data set option is used with PROC EXPORT:
data class;
set sashelp.class (rename=(sex=gender));
run;
proc export data=class(keep=name gender age)
outfile='c:\temp\class.csv' dbms=csv replace;
run;
A fix for this issue is planned for a future software release.
Operating System and Release Information
SAS System | Base SAS | Microsoft® Windows® for x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8 Pro 32-bit | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8 Enterprise x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8 Enterprise 32-bit | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8 Pro x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8.1 Enterprise x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8.1 Pro 32-bit | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 8.1 Pro x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows 10 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2012 Datacenter | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2012 R2 Datacenter | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2012 R2 Std | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2012 Std | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2016 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Microsoft Windows Server 2019 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Enterprise 32 bit | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Enterprise x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Home Premium 32 bit | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Home Premium x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Professional 32 bit | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Professional x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Ultimate 32 bit | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Windows 7 Ultimate x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
64-bit Enabled AIX | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
64-bit Enabled Solaris | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
HP-UX IPF | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Linux for x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 9.4 TS1M7 |
Solaris for x64 | 9.4_M6 | 9.4_M6 | 9.4 TS1M6 | 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: | 2020-02-11 10:33:43 |
Date Created: | 2019-08-09 13:45:30 |