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: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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