BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
claforest1
Fluorite | Level 6

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;
1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star
	where mainbankid in ('A363289', 'A108430', '6606272', '5521965'  '7022337', '5521965'  'A491999', 'A200760', '7062401', 'A331210', 'A055698',  '7021510', 'A070130', 'A058410', '7021510')

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star
	where mainbankid in ('A363289', 'A108430', '6606272', '5521965'  '7022337', '5521965'  'A491999', 'A200760', '7062401', 'A331210', 'A055698',  '7021510', 'A070130', 'A058410', '7021510')
claforest1
Fluorite | Level 6

I knew it was going to be something simple... Thank you! I am just beginning to learn SAS. I appreciate the help

SASKiwi
PROC Star

No problem! Don't forget to start exploring the SAS documentation at documentation.sas.com. Many answers can be found there too and quicker.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 8288 views
  • 0 likes
  • 2 in conversation