BookmarkSubscribeRSS Feed
Calcite | Level 5



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 



Diamond | Level 26

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).

Paige Miller
Calcite | Level 5

Hi Mellisa,


Please i would think you're trying to get the last status or the first status on your data.  Please add some SAS code that show us which are your inputs.




Juan R. Gomez

Super User Tom
Super User

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' ;

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 ;

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);




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. 

Register now!

How to Concatenate Values

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 4 in conversation