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

thank you for your support... I was trying both the approach and learning.

 

 

 

Mani1
Calcite | Level 5

I tried it  yesterday, and it worked well.

 

Thanks for your support.

ballardw
Super User

I think adding macro variables is just going to make things harder to maintain or understand.

 

If I understand your goal then something more like

proc sql;
    create table want as
    select <variable list>
    from dataset
    where dn in ('CH' 'HY' 'WH')
       and FC in ('ABC1' 'ABC2' '123ABC' '456ABC' 'ABCXYZ' 'ABCQWE')
       and SFC in ('ABC1234' 'ABC4567' )
       and PN  in ('ch1234' 'ch5678')
   ;
quit;

I didn't put your full list of values for SFC and PN but the pattern should be clear. ( and they appear to be dummy values as well)

 

 

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
  • 17 replies
  • 5008 views
  • 0 likes
  • 4 in conversation