Problem Note 5408: $ASCIIw. informat may overwrite other variables
It is possible for the $ASCIIw. informat to overwrite other variables.
For example:
DATA EXAMPLE;
LENGTH X $ 8;
OTHERVAR='0123456789';
PUT _ALL_;
INPUT X $ASCII15.;
PUT _ALL_;
DATALINES;
abcdefghijklmnopqrstuvwxyz
;
The result of the PUT statement in the SAS Log is:
X=abcdefgh OTHERVAR=ijklmno789 _ERROR_=0 _N_=1
The LENGTH statement assigns variable X a width of 8 which is shorter
than the width specified in the $ASCII15. informat. Even though
variable X is assigned a length of 8, the width of the $ASCII informat
is used to read 15 characters into the input buffer. Because the
variable OTHERVAR is coded prior to the INPUT statement, variable X is
assigned the first 8 of the 15 characters and the remaining 7
characters overlay the first 7 characters of OTHERVAR.
The same incorrect behavior can occur by using the LENGTH= option in
the ATTRIB statement and/or by using the $ASCIIw. informat with the
INPUT function.
The problem can be prevented by removing the LENGTH statement,
changing the length specification in the LENGTH statement to match the
width used with the $ASCII informat, or by moving the assignment
statement for OTHERVAR after the INPUT statement.
A Technical Support hot fix for Release 8.2 TSLEVEL TS2M0 for this
issue is available at:
http://www.sas.com/techsup/download/hotfix/82_sbcs_prod_list.html#005408
For customers running SAS with Asian Language Support (DBCS), this
hot fix should be downloaded from:
http://www.sas.com/techsup/download/hotfix/82_dbcs_prod_list.html#005408
Operating System and Release Information
| SAS System | Base SAS | Microsoft Windows 95/98 | 8 TS M0 | |
| Microsoft Windows 2000 Server | 8 TS M0 | 9 TS M0 |
| Microsoft Windows 2000 Datacenter Server | 8 TS M0 | 9 TS M0 |
| Microsoft Windows 2000 Professional | 8 TS M0 | 9 TS M0 |
| Microsoft Windows 2000 Advanced Server | 8 TS M0 | 9 TS M0 |
| OpenVMS VAX | 8 TS M0 | |
| Solaris | 8 TS M0 | |
| 64-bit Enabled Solaris | 8 TS M0 | |
| IRIX | 8 TS M0 | |
| OS/2 | 8 TS M0 | |
| ABI+ for Intel Architecture | 8 TS M0 | |
| z/OS | 8 TS M0 | 9 TS M0 |
| HP-UX | 8 TS M0 | |
| 64-bit Enabled HP-UX | 8 TS M0 | |
| Microsoft Windows NT Workstation | 8 TS M0 | 9 TS M0 |
| OpenVMS Alpha | 8 TS M0 | 9 TS M0 |
| CMS | 8 TS M0 | |
| Tru64 UNIX | 8 TS M0 | 9 TS M0 |
| 64-bit Enabled AIX | 8 TS M0 | |
| AIX | 8 TS M0 | |
*
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 ==> Informats
|
| Date Modified: | 2002-05-08 14:30:00 |
| Date Created: | 2001-07-11 12:45:16 |