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.
Like this?
by CTR;
if first.CTR then PAID_FOUND=0;
if STATUS='Paid' then
if PAID_FOUND then STATUS=' '; else PAID_FOUND+1;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.