can someone please help me.
I have a Colum with a few different statuses in that specific column.
I only want 1 status to show on my output- for example there is statuses fraud, Other, STP-Wait, i only want Fraud to display on my data output.
I am not sure what i am doing wrong but it gives me blanks- and i know there is a Fraud status.
please help me
I think in cases like this, you have to show us your code (please paste it into the box that appears when you click on the "little running man" icon) and you have to show us a portion of the data itself (not by typing some of it into a sentence, but by providing a portion as working SAS data step code).
What type of variable has the STATUS information? Is it numeric or character? Does it have a display format attached to it? Which one.
If the variable is character and does not have a format that changes how it is displayed attached then you need to make sure to use the same case letters and include any leading spaces (trailing spaces are ignored). 'Fraud' is different than 'FRAUD' or 'fraud' or ' Fraud'.
data want; set have; where upcase(left(status)) = 'FRAUD' ; run;
If the variable is numeric and has a user defined format attached to it that prints the values like Fraud then you need to know what actual numbers the format maps to Fraud.
data want; set have; where status = 1 ; run;
Or you could use a subsetting IF statement instead of WHERE statement. Then you could use the VVALUE() function to test the value as displayed by the format without needing to know the name of the format.
data want; set have; if 'Fraud' = vvalue(status); run;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.