Hello, I have a code similar to this one below. The problem is that it wont work in CAS. Can anyone help troubleshoot? At first the issue is the point function, and then when i comment that out it says invalid do loop control information. Any ideas on how to adapt this to run on cas?
data c;
set class; tmp1=soundex(fname); do i=1 to nobs; set grade(rename=(fname=fname2)) point=i nobs=nobs; tmp2=soundex(fname2); dif=compged(tmp1,tmp2); if dif<=50 then do; possible_match='Yes'; drop i tmp1 tmp2 fname2; output; end; end; run; proc print; run;
Imho only because with Viya there is now CAS doesn't mean we need to load everything into CAS for processing. I'd keep your source data in compute and there you can continue to use the code you've got.
Update: Proposed code using Proc FedSql for CAS processing removed because the soundex() function is not available with this proc.
If I were to remove the soundex and just keep COMPGED, would it still work?
@Vivy1 wrote:
If I were to remove the soundex and just keep COMPGED, would it still work?
Which functions fedsql supports is fully documented here.
I believe it would be best and certainly the least migration effort if you execute your code in compute against normal SAS tables and not in CAS. If you really want/need to execute in CAS and you've got the SAS DQ products licensed then consider using matchcodes with an approach similar to Coding for Data Quality in SAS Viya Part 3 – Matching
You would first create the matchcodes and then use Proc FedSql for a join over the matchcodes - or for this you could also use a data step with a hash lookup and the do_over() method.
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.