I'm running macro code that sets random start values and compiles the results of a proc command. It's a loop that continues until one of several conditions is met. From time to time, one of these random start values results in a floating point overflow. SAS reacts differently to this error in Windows and Linux. In Windows, I get the following:
ERROR: Floating Point Overflow
ERROR: Termination due to Floating Point Exception
NOTE: The SAS System stopped processing this step because of errors.
It then exits the macro. But I set up the code so that it repeatedly calls the macro. So in Windows it just goes on to the next command that tells it to restart the macro. The code proceeds with new random start values, and all is well. In Linux, however, this is a fatal error:
ERROR: Floating Point Overflow
ERROR: Termination due to Floating Point Exception
NOTE: The SAS System stopped processing this step because of errors.
NOTE: SAS set option OBS=0 and will continue to check statements. This might cause NOTE: No observations in data set.
This results in a long string of error messages until the program dies. I want SAS in Linux to behave as it does in Windows. I checked the error handling system options in the two environments using proc options group=errorhandling. All of the error handling options settings are identical across the two environments. I tried setting an options statement "options obs=max" right after the part of the program that sometimes results in the floating point overflow to override the obs=0 option. No dice. One other difference is that I'm running the Linux syntax in batch mode. Any ideas on what else I can do so that SAS does not respond with "obs=0" in Linux?
My two environments, if that helps, are:
X64_7PRO WIN 6.1.7601 Service Pack 1, SAS 9.4 (TS1M0)
Linux 3.10.0-693.21.1.e17.x86_64, SAS 9.4 (TS1M0)
Thanks.
Worth a try (no guarantees) and use at your own risk (see documentation):
options nosyntaxcheck;
Worth a try (no guarantees) and use at your own risk (see documentation):
options nosyntaxcheck;
Thank you! This worked. The different error handling was due to the Linux environment being run in batch mode. Both environments had the same error handling options, but NODMSSYNCHK only applied in the windowing environment, and SYNTAXCHECK only applied in batch mode. Changing the option to NOSYNTAXCHECK made them both run the same. You have to trust your code to do this in batch mode though.
Or try resetting options OBS=max; after each macro call.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: