Usage Note 30911: SUBSTRN function cannot be used on left side of ASSIGNMENT statement
The SUBSTR function can be used on the left and right sides of an ASSIGNMENT statement. The SUBSTRN function can be used on the right side only.
x=substrn(y,3,2);
If the SUBSTRN function is used on the left side, an error results since SAS assumes SUBSTRN is an array reference.
data _null_;
y='test string';
substrn(y,3,2)='CAT';
run;
ERROR: Undeclared array referenced: substrn.
ERROR: Variable substrn has not been declared as an array.
Operating System and Release Information
| SAS System | Base SAS | z/OS | 9.1 TS1M0 | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.1 TS1M0 | |
| Microsoft Windows 2000 Advanced Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Datacenter Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Server | 9.1 TS1M0 | |
| Microsoft Windows 2000 Professional | 9.1 TS1M0 | |
| Microsoft Windows NT Workstation | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M0 | |
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M0 | |
| Microsoft Windows XP Professional | 9.1 TS1M0 | |
| 64-bit Enabled AIX | 9.1 TS1M0 | |
| 64-bit Enabled HP-UX | 9.1 TS1M0 | |
| 64-bit Enabled Solaris | 9.1 TS1M0 | |
| HP-UX IPF | 9.1 TS1M0 | |
| Linux | 9.1 TS1M0 | |
| OpenVMS Alpha | 9.1 TS1M0 | |
| Tru64 UNIX | 9.1 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.
| Type: | Usage Note |
| Priority: | |
| Topic: | SAS Reference ==> Functions ==> Character ==> SUBSTRN
|
| Date Modified: | 2008-01-11 14:09:07 |
| Date Created: | 2008-01-11 11:22:23 |