Problem Note 3430: Formatting a numeric variable with a length of less than 8 can produce
incorrect results
Formatting a numeric variable with a length of less than 8 can produce
incorrect results. This can occur if the format being applied is a
user-defined format that uses an existing format as a label.
The output from the following PROC PRINT illustrates the problem:
PROC FORMAT;
VALUE TEST OTHER=[DATE9.];
RUN;
DATA ONE;
LENGTH X 4;
X='01JUL2000'D;
FORMAT X TEST.;
RUN;
PROC PRINT;
RUN;
Produces:
Obs X
1 01JAN1960
Since the values of numeric variables are kept in full 8-byte
floating-point representation in the program data vector within a DATA
step, a PUT statement will not reproduce this problem.
To circumvent the problem, assign a length to the variable that is long
enough to properly display the value.
A Technical Support hot fix for Release 8.1 TSLEVEL TS1M0 for this
issue is available at:
http://www.sas.com/techsup/download/hotfix/81_sbcs_prod_list.html#003430
This problem is also fixed in Release 8.2.
Operating System and Release Information
| SAS System | Base SAS | Microsoft Windows NT Workstation | 8 TS M1 | 8.2 TS2M0 |
| Microsoft Windows 2000 Professional | 8 TS M1 | 8.2 TS2M0 |
| Microsoft Windows 2000 Server | 8 TS M1 | 8.2 TS2M0 |
| Microsoft Windows 95/98 | 8 TS M1 | 8.2 TS2M0 |
| Microsoft Windows 2000 Advanced Server | 8 TS M1 | 8.2 TS2M0 |
| Microsoft Windows 2000 Datacenter Server | 8 TS M1 | 8.2 TS2M0 |
*
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 ==> FORMAT
|
| Date Modified: | 2002-05-14 14:40:01 |
| Date Created: | 2000-09-12 15:15:22 |