BookmarkSubscribeRSS Feed

[SAS 프로그래밍 고수 백승민] [관측치] 데이터 세트에서 마지막 관측치 N개 출력(추출)하기

Started ‎06-11-2020 by
Modified ‎06-11-2020 by
Views 194

* 출처 : http://cafe.daum.net/statsas/3F8j/165

* 데이터 세트에서 마지막 관측치 5개 출력하기

* 총관측치 중에서 총관측치-5개의 수자를 매크로 변수로 할당.

data _null_;
  if 0 then set sashelp.class nobs=totobs;
  call symputx('start',put(totobs-5,15.));
  stop;
run;

%put &start;

* (총관측치-5개의 수자) 에서 시적하여 관측치 출력;

proc print data=sashelp.class(firstobs=&start);
run;
 

Version history
Last update:
‎06-11-2020 05:07 AM
Updated by:
Contributors

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Article Labels
Article Tags