Hello all, I have the following code and my goal is to have a txt. export with a header that includes the number of rows/obs from my dataset. DATA have;
SET have END=EOF;
file "filepath.txt" dlm='|';
put (_all_)(~);
IF EOF then
do;
put 'Number of Rows:'_n_:Z7.;
end;
run; As it is now, the only way I could get _n_ to include a count of rows/obs was to put it at the end. When I used: if _n_>0 then do; put 'Number of Rows:'_n_:z7.; end; run; then the header was at the top of the file, but _n_ = 1. Any help is much appreciated. Thank you.
... View more