Hi All,
I am trying to delete the last 3 row where last row "label=B_Contingencies" (highlighted in image).
I tried rownum and partition but seems like sas doesn't support it.
Show us your code please.
This was throwing error as "Syntax expecting one of the following: !,!!, &, *, **, +,-,/,* <,>,<>,="
And what do you expect as result?
The expected result.
Something like this should work. Code is untested:
data want;
_p = 0;
do _n_ = 1 by 1 until(done);
set work.have end=done;
if label = 'INSERT_TEXT' then _p = _n_;
end;
do _n_ = 1 by 1 until(_p - 1 = _n_);
set work.have;
output;
end;
drop _p;
run;
Assuming that 'end' provides some meaningful order, then you can try this.
* sort by label and end to group by label;
proc sort data=iqfmt;
by label end;
run;
* then sort by label removing duplicate labels;
proc sort data=iqfmt nodupkey;
by label;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.