Desktop productivity for business analysts and programmers

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

Reply
Regular Contributor
Posts: 174

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

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

Respected Advisor
Posts: 2,178

Re: Need to check for the existence of a particular value in a character variable in SAS data set

%let value_exists=0;

data _null_;

    set tracker;

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

run;

--
Paige Miller
Regular Contributor
Posts: 174

Re: Need to check for the existence of a particular value in a character variable in SAS data set

Posted in reply to PaigeMiller

Thank you ...

Ask a Question
Discussion stats
  • 2 replies
  • 205 views
  • 0 likes
  • 2 in conversation