Hi Qiqi,
try making a counter which is set to some value say =0 and as soon as the name='F' is encountered change the value of the counter to say = 1. Use the output statement based on that counter.
data test;
input name:$4. data1:$char10. ;
cards;
A dummy
B dummy
C dummy
D dummy
E dummy
F dummy
G dummy
H dummy
;;;;
run;
data d1(drop=counter);
set test;
retain counter;
if _n_=1 then counter=0;
if name ='F' then counter=1;
if counter=1 or name='F';
run;
proc print;run;