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;

 

 

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 812 views
  • 0 likes
  • 4 in conversation