Dear team,
Can someone explain the next Warning and how it can be resolved inside the PROC FCMP function?
N = CDF('NORMALTGAUSS', 1);
R2 = (y*N);
if n='false' and x ne 1 then RA = R2*m;
else...
WARNING: The variable 'n' should not be the result of the '=' operation because it is a read-only argument to 'RA'. Any changes
to this argument will not be returned from 'RA'. Use the OUTARGS statement to allow return values.
Hello @Stepik,
Variable names in SAS are case-insensitive, so n and N are the same. Most likely you used n as an argument (more precisely: a character argument) to function RA in the FUNCTION statement, but then you use N like a numeric variable to store a probability. Just use a different name for this numeric variable.
I'm curious where in the documentation you found a 'NORMALTGAUSS' distribution. Is it different from the 'NORMAL' distribution?
Hint: It's best practice in the SAS Support Communities to show the entire log of a DATA or PROC step if you get an unexpected note, warning or error. (Use the window opened with the </> button to preserve formatting of the pasted log text.) In this case we would have seen the FUNCTION statement with the argument n.
Hello @Stepik,
Variable names in SAS are case-insensitive, so n and N are the same. Most likely you used n as an argument (more precisely: a character argument) to function RA in the FUNCTION statement, but then you use N like a numeric variable to store a probability. Just use a different name for this numeric variable.
I'm curious where in the documentation you found a 'NORMALTGAUSS' distribution. Is it different from the 'NORMAL' distribution?
Hint: It's best practice in the SAS Support Communities to show the entire log of a DATA or PROC step if you get an unexpected note, warning or error. (Use the window opened with the </> button to preserve formatting of the pasted log text.) In this case we would have seen the FUNCTION statement with the argument n.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.