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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.