Good Morning,
What is more efficient and faster , attaching my WHERE clause to the SET statement or within the DATA step, which is what I am currently using ? I reading from a dataset using a hash table . Appreciate any advice. Thanks
data USI_CLAIMS_DATA;
length CPT_CODE $5.;
if _N_ =1 then do;
DECLARE HASH H(dataset:'USI_CPTCODES');
H.DEFINEKEY ('CPT_CODE');
H.DEFINEDONE();
end;
SET CLAIMS_MASTER(keep=&claims_header);
where serv_from_date ge '1Jan2014'd;
if H.find(key:hcpcs_cpt4_base_cd1) = 0 then output;
run;
It is more efficient to place it in the SET statement because then the data is filtered before you start processing it. This can be noted as using a DATA SET OPTION vs a WHERE statement.
It is more efficient to place it in the SET statement because then the data is filtered before you start processing it. This can be noted as using a DATA SET OPTION vs a WHERE statement.
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.