Hi all!
I just have a very urgent question. I find that my SAS program gives different results when run different times. To be concrete, when I run it in this week (for several times), all the results are the same and consistent. However, after several days, like half a month, the results will change even I don't change anywhere (the same code and computer). The program includes several macros, but I check that there is no apparent mistake.
Can you please tell me why this happens? Is there any problem?
I appreciate it very much for your warm help!
Hi @xizidememeda,
As mentioned by KurtBremser, two runs of the same program on the same input datasets and raw data files can give different results because (1) certain functions or procedures do so or because of (2) changes in the environment:
If I had to investigate this and no changes in the environment were known, my first step would be a thorough comparison of the log files. Needless to say, there must be no errors etc. Has the documented number of observations or variables changed anywhere? If not, I would pick one particular value which has changed significantly and trace it back meticulously all the way to the input data.
The community is not the right place to discuss "urgent" matters. Contacting sas technical support is recommended. Because without the code and the complete logs, it is hardly possible to be of any assistance. And i am somewhat sure, that hardly anybody here has the time to analyse "several macros".
Same program + different results = different input data.
"input data" can be datasets or files that you import, but also the result of environment-dependent functions like TODAY().
One wonders why if the results are expected to be the same why you are rerunning the "same code"?
Hi @xizidememeda,
As mentioned by KurtBremser, two runs of the same program on the same input datasets and raw data files can give different results because (1) certain functions or procedures do so or because of (2) changes in the environment:
If I had to investigate this and no changes in the environment were known, my first step would be a thorough comparison of the log files. Needless to say, there must be no errors etc. Has the documented number of observations or variables changed anywhere? If not, I would pick one particular value which has changed significantly and trace it back meticulously all the way to the input data.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.