Hi,
Does anyone have an example of the correct way to enter the syntax for '%syscall compcost'? Having a real hard time trying to find an example of this on the web!
I've gone down the path of trial and error, and I've found that the following syntax at least doesn't trigger an error:
%let a = insert;
%let b = 1;
%syscall compcost(a,b);
However, the changes don't seem to be taking effect when I perform a COMPGED function.
I know how to use compcost within a data step, but for the work I'm doing at the moment it will be more practical to modify the COMPGED values on the global scale using %syscall compcost. Can anyone help?
This implies "to me" that it does work.
Oh ok... so thats working within a macro statement. Maybe my problem is that I'm trying to use this function in open code. I'll package what I'm doing into a macro instead and see how that goes. Cheers for the advice!
I used the macro to loop the value B but this open code appears to work. What version of SAS are you using?
Version 9.3, I think...
What happens with the following bit of code? I'd give it a go myself but I can't access from home lol
%let a = insert;
%let b = 5000;
%syscall compcost(a,b);
data ged_test;
str1 = 'balloon';
str2 = 'xballoon';
ged = compged(str1, str2);
run;
Is the value of variable 'ged' in the resulting dataset still 5000?
No it appears the SYSCALLed COMPCOST only works for %SYSFUNCed COMPGED. See slightly modified example. If you un-comment the CALL COMPCOST in the data step you can execute COMCOST with values of &A and &B;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.