BookmarkSubscribeRSS Feed

[SAS 활용 FAQ] 데이터요약 – RETAIN 문

Started ‎11-09-2021 by
Modified ‎11-09-2021 by
Views 484
  • DATA Step iteration 시 DATA Step 상단에서 새로 생성한 변수의 값이 초기화하지 않게 해 줌.
  • 초기값을 설정하지 않을 경우, DATA Step 첫번째 iteration 전에 결측값으로 초기화 함.
  • 컴파일 시점 문장임.
  • 변수 생성 기능이 있음.

RETAIN   변수명 <초기값> ;

 

◀예제하나의 입력 관측치마다 여러 출력 관측치 생성.

data new;

set sashelp.air;

 

retain total 100

title 'International Airline Travel';

 

 total = sum(total , air) ;

run;

Version history
Last update:
‎11-09-2021 03:19 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