Hi All. I'm trying to run the code below and getting an error saying ERROR: Variable srcLOB is not on file HCGOUT.OUTCLAIMS_xxxx.
I don't know why this would be the cases, because I've checked using Proc Contents and the variable does exist. Any idea why this is happening?
libname hcgout "/sasapps/HCG/HCG_PROD/Data_Sets/Output_NET";
%let list = linenum memberid memberctg incurd_yr_mo hcpcs;
%let hcpc = "E0431" "E1390" "E1392" "K0738";
%let loblist = "MCAD" "MCHM";
data hcgTables2014toPresent ;
set hcgout.outclaims_2014 (where= (hcpcs in (&hcpc.) and srcLOB in (&loblist.)) keep=&list. rename=(incurd_yr_mo = date))
hcgout.outclaims_2015 (where= (hcpcs in (&hcpc.) and srcLOB in (&loblist.)) keep=&list. rename=(incurd_yr_mo = date))
hcgout.outclaims_prior (where= (hcpcs in (&hcpc.) and srcLOB in (&loblist.)) keep=&list. rename=(incurd_yr_mo = date))
hcgout.outclaims_current (where= (hcpcs in (&hcpc.) and srcLOB in (&loblist.)) keep=&list. rename=(incurd_yr_mo = date));
run;
Make it a point to always write dataset options in this order:
because that is the sequence in which they are applied by SAS, irrespective of the order in which you write them. That helps to make the code easier to understand and maintain.
@Kurt_Bremser wrote:
Make it a point to always write dataset options in this order:
- keep/drop
- rename
- where
because that is the sequence in which they are applied by SAS, irrespective of the order in which you write them. That helps to make the code easier to understand and maintain.
Note you can remember the order easily because it is alphabetical. Drop,Keep,Rename,Where.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.