Prev: nlmixed help
Next: 9.2 with SAS/Access for MySQL
From: Kevin Myers on 14 Oct 2009 20:15 Ok, maybe I am just being dense, but I am unable to get the VARARGS option of the FUNCTION statement of PROC FCMP to work. I tried something as close to straight from the docs as possible, and here is the result: 480 proc fcmp outlib=work.test.test; WARNING: No CMP or C functions found in library work.test. 481 function summation (b[*]) varargs; 482 total = 0; 483 do i = 1 to dim(b); 484 total = total + b[i]; 485 end; 486 return(total); 487 endsub; 488 run; NOTE: Function summation saved to work.test.test. NOTE: PROCEDURE FCMP used (Total process time): real time 0.06 seconds cpu time 0.01 seconds ? 489 490 options cmplib=work.test; 491 data _null_; 492 s=summation(1,2,3,4,5); 492 s=summation(1,2,3,4,5); --------- 72 ERROR 72-185: The summation function call has too many arguments. 492 s=summation(1,2,3,4,5); --------- 707 ERROR 707-185: Expecting array for argument 1 of the summation subroutine call. 493 put s=; 494 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds Most of the code above, including the function definition and the function call, was copied straight from the docs. What am I doing wrong? s/KAM
|
Pages: 1 Prev: nlmixed help Next: 9.2 with SAS/Access for MySQL |