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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.