BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

data have;

length ctr Status $25.;

input ctr cnt cnt2 Status;

return;

datalines;

 

4544 2 1 Paid

4544 3 1 Paid  /*suppress the name paid but keep record*/

4544 4 1 Paid

4544 5 1 Paid

4465 10 1

4465 5 1

4475 1 0

4475 2 0 Paid

4475 3 1 Paid /*suppress the name paid but keep record*/

4476 5 2

4476 6 1 Paid

;

run;

Is there a way to keep all record however suppress the name "Paid" after it shows the first time? So in a series per ctr, if the status is "Paid", I want to see it displayed on the first instance only but keep all record.

 

3 REPLIES 3
tomrvincent
Rhodochrosite | Level 12
See it displayed in what?

What have you tried so far?
andreas_lds
Jade | Level 19
Use SET and BY CTR, maybe add NOTSORTED if the data is grouped by CTR, but not sorted. The use
if not first.ctr then Status = " ";
ChrisNZ
Tourmaline | Level 20

Like this?

by CTR;
if first.CTR then PAID_FOUND=0;
if STATUS='Paid' then 
  if PAID_FOUND then STATUS=' '; else PAID_FOUND+1;

 

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 3 replies
  • 464 views
  • 0 likes
  • 4 in conversation