Hi - I am looking to list multiple values in one variable I want to include in a proc SQL table under a where statement. The code listed below did not work. What am I missing/doing wrong? Thank you!
proc sql;
create table largesmall_&date_input. as select
&date_input. as asofdate,
mainbank,
mainbankid,
loansize,
sum(lst12mn_count) as lst12mn_count,
sum(lst12mn_grsapproval) as lst12mn_grsapproval
from lenders_&date_input.
where mainbankid='A363289' or 'A108430' or '6606272' or '5521965' or '7022337' or '5521965'
or 'A491999' or 'A200760' or '7062401' or 'A331210' or 'A055698' or '7021510'
or 'A070130' or 'A058410' or '7021510'
group by 1,2,3,4
;
quit;
where mainbankid in ('A363289', 'A108430', '6606272', '5521965' '7022337', '5521965' 'A491999', 'A200760', '7062401', 'A331210', 'A055698', '7021510', 'A070130', 'A058410', '7021510')
where mainbankid in ('A363289', 'A108430', '6606272', '5521965' '7022337', '5521965' 'A491999', 'A200760', '7062401', 'A331210', 'A055698', '7021510', 'A070130', 'A058410', '7021510')
I knew it was going to be something simple... Thank you! I am just beginning to learn SAS. I appreciate the help
No problem! Don't forget to start exploring the SAS documentation at documentation.sas.com. Many answers can be found there too and quicker.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.