BookmarkSubscribeRSS Feed
Sheeba
Lapis Lazuli | Level 10

How to check for the existence of a particular value in a character variable in SAS data set?


I have a data set named tracker which has a character variable proj name.....How do I check if the current project name is existing in the tracker.

I have captured the project name using the macro variable, _clientprojectname.

How do i check whether that value exist on the tracker data set?

Regards,

Sheeba Swaminathan

2 REPLIES 2
PaigeMiller
Diamond | Level 26

%let value_exists=0;

data _null_;

    set tracker;

    if proj_name="&_clientprojectname" then call symputx('value_exists',1);

run;

--
Paige Miller

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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