BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Yuna11
Fluorite | Level 6

Hi guys,

I want to delete the rows that have all "(,)", "(,)", "(,)" (i.e., row 10) and then if that's true, always delete row-4;  for example, in the table below, I want to delete row 6-10; 11-15; 16-20; 21-25. Any suggestions? 

 

Would something like below work? 

Data final2;set Final; if _1="(, )" and _2="(, )" and _3="(, )" then Delete="Y";run;
Data final2;
do i=0,1,2,3,4;
if delete="Y" then do p=_n_-i;
set final2 point=p;
delete;
end;
end;
stop;
run;

 

test.png

1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

This looks like a report, not a dataset.  Did you create this table (using PROC REPORT, PROC TABULATE, or similar?)

 

It's probably a better idea to change the creation of the report, rather than read the report into a dataset and delete rows and then print it out.

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.

View solution in original post

2 REPLIES 2
Quentin
Super User

This looks like a report, not a dataset.  Did you create this table (using PROC REPORT, PROC TABULATE, or similar?)

 

It's probably a better idea to change the creation of the report, rather than read the report into a dataset and delete rows and then print it out.

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.
Yuna11
Fluorite | Level 6
Yes, it is a report. Thanks for your suggestion, I will try work on the creation of report then.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 727 views
  • 1 like
  • 2 in conversation