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.

SAS Innovate 2025: Register Now

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!

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
  • 7293 views
  • 0 likes
  • 2 in conversation