![]() | ![]() | ![]() | ![]() |
SAS/ACCESS® Interface to Oracle adds trailing blanks at the end of a variable when you bulk load data to the Oracle database. The SAS® System handles reading variables of type VARCHAR this way because SAS does not have a variable-length data type. Therefore, variable values that are less than the full length of the variable are padded with blanks. For example, suppose a variable is defined with a length of 10 and you store the value ABC in the variable. What the software actually stores is the value ABC followed by seven blanks.
To remove the trailing blanks at the end of a variable, use any of the following options:
Code examples that illustrate how to avoid the trailing blanks:
/* Sample_20100816_2: Oracle bulk loading, without trailing blanks, into NOT NULL columns. */ /* Use BULKLOAD=YES and reload the rejected rows. */ /* Variables need to be modified. */ %let myuser=user-id; %let mypass=password; %let mypath=path-name; /* End of modified variables. */ /* Generic code */ data test; length info $30.; id=21; info='good data'; output; id=22; info=''; output; id=23; info=' '; output; run; libname x oracle user=&myuser pass=&mypass path=&mypath; /* You might need to adject the file path depending on the platform used */ proc append base=x.amy_bulk(bulkload=yes bl_datafile="c:/temp/amy_bulk.dat" bl_delete_datafile=no) data=test; run; /* End of sample_20100816_2*/
To load the rejected rows:
Note: In case A, the KEEP= and DROP= data set options work for the APPEND procedure, with the insertion of limited columns inserted. However, the following warning is issued in the log, regardless, if you use the system options DKROCOND=NOWARN and DKRICOND=NOWARN along with the FORCE NOWARN procedure option.
'WARNING: The DROP, KEEP AND RENAME options are ignored for the BASE data set.'
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS/ACCESS Interface to Oracle | Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 SP4 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Server | 9.1 TS1M3 SP4 | |||
Microsoft Windows 2000 Professional | 9.1 TS1M3 SP4 | |||
Microsoft Windows NT Workstation | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 SP4 | |||
Microsoft Windows XP Professional | 9.1 TS1M3 SP4 | |||
Windows Vista | 9.1 TS1M3 SP4 | |||
Windows Vista for x64 | 9.1 TS1M3 SP4 | |||
64-bit Enabled AIX | 9.1 TS1M3 SP4 | |||
64-bit Enabled HP-UX | 9.1 TS1M3 SP4 | |||
64-bit Enabled Solaris | 9.1 TS1M3 SP4 | |||
HP-UX IPF | 9.1 TS1M3 SP4 | |||
Linux | 9.1 TS1M3 SP4 | |||
Linux on Itanium | 9.1 TS1M3 SP4 | |||
OpenVMS Alpha | 9.1 TS1M3 SP4 | |||
Solaris for x64 | 9.1 TS1M3 SP4 | |||
Tru64 UNIX | 9.1 TS1M3 SP4 | |||
Microsoft® Windows® for x64 | 9.2 TS2M3 | |||
Microsoft Windows Server 2003 for x64 | 9.2 TS2M3 | |||
Microsoft Windows Server 2008 | 9.2 TS2M3 | |||
Microsoft Windows Server 2008 for x64 | 9.2 TS2M3 | |||
Windows 7 Enterprise 32 bit | 9.2 TS2M3 | |||
Windows 7 Enterprise x64 | 9.2 TS2M3 | |||
Windows 7 Home Premium 32 bit | 9.2 TS2M3 | |||
Windows 7 Home Premium x64 | 9.2 TS2M3 | |||
Windows 7 Professional 32 bit | 9.2 TS2M3 | |||
Windows 7 Professional x64 | 9.2 TS2M3 | |||
Windows 7 Ultimate 32 bit | 9.2 TS2M3 | |||
Windows 7 Ultimate x64 | 9.2 TS2M3 | |||
Linux for x64 | 9.2 TS2M3 | |||
OpenVMS on HP Integrity | 9.2 TS2M3 |