Problem Note 2442: Overflow error occurs when using a %DO loop that decrements from
positive to negative
If you are using a negative integer as your %BY value and you cross
from a positive value to a negative value without hitting zero, you
will receive the following errors:
ERROR: The current value of the %DO loop index variable I is 1;
the by value is -2; an overflow
will occur at the next evaluation with a value of -1.
ERROR: Overflow has occurred; evaluation is terminated.
ERROR: The macro TEST will stop executing.
The sample code below causes the errors above:
%macro test;
%do i=3 %to -1 %by -2;
%put i=&i;
%end;
%mend test;
%test
There is no efficient workaround for this problem.
Operating System and Release Information
| Product Family | Product | System | Reported Release | Fixed Release* |
| SAS System | Base SAS | Microsoft Windows 95/98 | 8 TS M0 | 8.1 TS1M0 |
| Microsoft Windows NT Workstation | 8 TS M0 | 8.1 TS1M0 |
| 64-bit Enabled Solaris | 8 TS M0 | 8.1 TS1M0 |
| OpenVMS VAX | 8 TS M0 | 8.1 TS1M0 |
| Solaris | 8 TS M0 | 8.1 TS1M0 |
| ABI+ for Intel Architecture | 8 TS M0 | 8.1 TS1M0 |
| z/OS | 8 TS M0 | 8.1 TS1M0 |
| OS/2 | 8 TS M0 | 8.1 TS1M0 |
| IRIX | 8 TS M0 | 8.1 TS1M0 |
| HP-UX | 8 TS M0 | 8.1 TS1M0 |
| OpenVMS Alpha | 8 TS M0 | 8.1 TS1M0 |
| 64-bit Enabled HP-UX | 8 TS M0 | 8.1 TS1M0 |
| CMS | 8 TS M0 | 8.1 TS1M0 |
| Microsoft Windows 2000 Professional | 8 TS M0 | 8.1 TS1M0 |
| 64-bit Enabled AIX | 8 TS M0 | 8.1 TS1M0 |
| Tru64 UNIX | 8 TS M0 | 8.1 TS1M0 |
| AIX | 8 TS M0 | 8.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: | Problem Note |
| Priority: | high |
| Topic: | SAS Reference ==> Macro
|
| Date Modified: | 2000-07-03 16:44:42 |
| Date Created: | 2000-04-14 12:31:28 |