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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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