Hello
I am getting below log message when i used EXP function
I am removing missing values before passing , but still i am getting
data step :
if nmiss(gmean)=0 then gmean1=exp(gmean);
run;
PARTN=1 PARTTXT=Part 1 Dose Escalation TRTP=3 mg/kg PARAM=Carboxy-Dabrafenib PARAMCD=2298683 AVISITN=50 AVISIT=WEEK 1 DAY 1
ATPTNUM=70 ATPT=4 HOURS POST DOSE _TYPE_=0 _FREQ_=1 n1=1 nc=1 mean1=2968.26 gmean=2968.26 max1=2968.26 min1=2968.26 sd= gsd=
med=2968.26 CV1= gmean1= gcv= _ERROR_=1 _N_=3
NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to
missing
values.
@RajasekharReddy wrote:
.....
PARTN=1 PARTTXT=Part 1 Dose Escalation TRTP=3 mg/kg PARAM=Carboxy-Dabrafenib PARAMCD=2298683 AVISITN=50 AVISIT=WEEK 1 DAY 1
ATPTNUM=70 ATPT=4 HOURS POST DOSE _TYPE_=0 _FREQ_=1 n1=1 nc=1 mean1=2968.26 gmean=2968.26 max1=2968.26 min1=2968.26 sd= gsd=
med=2968.26 CV1= gmean1= gcv= _ERROR_=1 _N_=3
NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to
missing
values.
Looks like a value for gmean of 2968.26 is above the limit.
From the documentation:
The result is limited by the maximum value of a floating-point value on the computer.
28 data test; 29 do gmean=1,2,.,2968.26; 30 if nmiss(gmean)=0 then gmean1=exp(gmean); 31 end; 32 stop; 33 run; NOTE: Invalid argument to function EXP(2968.26) at line 30 column 35. gmean=2968.26 gmean1=. _ERROR_=1 _N_=1 NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values.
Just by trying in a SAS9.4 environment it appears the limit is somewhere below a value of 710.
28 data test; 29 do gmean=1 to 3000; 30 if nmiss(gmean)=0 then gmean1=exp(gmean); 31 end; 32 stop; 33 run; NOTE: Invalid argument to function EXP(710) at line 30 column 35. NOTE: Invalid argument to function EXP(711) at line 30 column 35.
Hello,
Here is a simple calculation of the limit :
%let MAXITER=10000;
%let precision=1.0e-12;
data step;
mini=0;
maxi=3000;
do i=1 to &MAXITER. until (maxi-mini<&precision.);
try=(maxi+mini)/2;
res=exp(try);
if _ERROR_=1 then do;
_ERROR_=0;
maxi=try;
end;
else mini=try;
end;
res=exp(mini);
put mini= res=;
run;
NOTE: Invalid argument to function EXP(1500) at line 701 column 13.
NOTE: Invalid argument to function EXP(750) at line 701 column 13.
NOTE: Invalid argument to function EXP(726.5625) at line 701 column 13.
NOTE: Invalid argument to function EXP(714.84375) at line 701 column 13.
NOTE: Invalid argument to function EXP(711.9140625) at line 701 column 13.
NOTE: Invalid argument to function EXP(710.44921875) at line 701 column 13.
NOTE: Invalid argument to function EXP(710.08300781) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.89990234) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.80834961) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78546143) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78403091) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78331566) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78295803) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78277922) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78273451) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78272334) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271775) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271496) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271356) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271321) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271303) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271295) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.7827129) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.7827129) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.7827129) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271289) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271289) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271289) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271289) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271289) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271289) at line 701 column 13.
NOTE: Invalid argument to function EXP(709.78271289) at line 701 column 13.
mini=709.78271289 res=1.797693E308
NOTE: Mathematical operations could not be performed at the following places. The results of the
operations have been set to missing values.
Each place is given by: (Number of times) at (Line):(Column).
32 at 701:13
NOTE: The data set WORK.STEP has 1 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
@gamotte: Nice algorithm. But why not simply
data _null_;
x=log(constant('big'));
put x=;
run;
Actually, this turns out to be the smallest number which exceeds the admissible range. Subtracting one unit of the least significant bit yields the largest number within the range (now assuming Windows/Unix):
data _null_;
x=log(constant('big'));
put x= best20. x hex16.;
t=x-2**(floor(log2(x))-52);
put t= best20. t hex16.;
run;
x=709.782712893384 40862E42FEFA39EF t=709.782712893383 40862E42FEFA39EE
@RajasekharReddy: Realizing that you tried to calculate a 1290-digit number (not counting decimals), you should really double-check the formula for the geometric mean or whatever you wanted to compute with your code.
Thanks. I didn't know "constant('big')" of course, hence the algorithm.
Please post the whole log of the step. Use the {i} button for posting logs.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.