Problem Note 36119: KINDEX function incorrectly returns a 1 when second argument is null
The KINDEX function incorrectly returns a 1 when the second argument is null. Following are two examples that incorrectly return the value of 1.
data _null_;
value='abcd';
wrongvalue=index(value,trimn(" "));
put wrongvalue=;
run;
%let val=%str(xyz);
%put wrongresult=%sysfunc(kindex(&val,%str()));
This problem has been addressed to correctly return a 0 in SAS 9.2.
Operating System and Release Information
| SAS System | Base SAS | z/OS | 9.1 TS1M3 | 9.2 TS1M0 |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M3 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M3 | 9.2 TS1M0 |
| Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | 9.2 TS1M0 |
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | 9.2 TS1M0 |
| Microsoft Windows XP Professional | 9.1 TS1M3 | 9.2 TS1M0 |
| Windows Vista | 9.1 TS1M3 | 9.2 TS1M0 |
| 64-bit Enabled AIX | 9.1 TS1M3 | 9.2 TS1M0 |
| 64-bit Enabled HP-UX | 9.1 TS1M3 | 9.2 TS1M0 |
| 64-bit Enabled Solaris | 9.1 TS1M3 | 9.2 TS1M0 |
| HP-UX IPF | 9.1 TS1M3 | 9.2 TS1M0 |
| Linux | 9.1 TS1M3 | 9.2 TS1M0 |
| OpenVMS Alpha | 9.1 TS1M3 | 9.2 TS1M0 |
| Tru64 UNIX | 9.1 TS1M3 | 9.2 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.
The KINDEX function should return a 0 when the second argument is null, but is returning a 1.
| Type: | Problem Note |
| Priority: | high |
| Topic: | SAS Reference ==> DATA Step Common Programming Tasks ==> Conditional Processing Common Programming Tasks ==> Selecting Data Common Programming Tasks ==> Working with Character Data Common Programming Tasks SAS Reference ==> Functions ==> Functions Data Management
|
| Date Modified: | 2009-06-09 15:03:39 |
| Date Created: | 2009-06-02 12:50:13 |