본문 바로가기
SAS

[관측치] 데이터 세트에서 마지막 관측치 N개 출력...

by 기서무나구물 2018. 11. 19.

포스팅 목차

    Programming Category (English)728x90

     

    * 데이터 세트에서 마지막 관측치 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;

     

    * 통계분석연구회 : http://cafe.daum.net/statsas

    * 백승민홈페이지 : http://www.statwith.pe.kr



     백승민님의 파란블로그에서 발행된 글입니다.


    반응형

    댓글