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: 155

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

Trusted Advisor
Posts: 1,496

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;

Regular Contributor
Posts: 155

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

Thank you ...

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