BookmarkSubscribeRSS Feed

[4-4-2] Creating Macro Variables in SQL

Started ‎06-16-2020 by
Modified ‎06-16-2020 by
Views 155

[4-4-2] Creating Macro Variables in SQL

 

 

안녕하세요^^

 

 

이번 시간에는 SQL Procedure를 사용하여

하나의 매크로 변수에 특정 컬럼의 값들을 저장하는 방법에 대해 공부해 보겠습니다.

 

 

 

하나의 매크로 변수에 특정값의 목록을 생성하기 위한 프로그램 형태는 다음과 같습니다.

 

SE22016091520470370.png

 

 

 

 

 

그럼 예시를 들어 익혀보도록 하겠습니다.

 

country_name DATASET에 나라명 중복값이 있는 Country 변수를 생성하였습니다.

 

 

SE22016091520473470.jpg

 

SE22016091520474270.jpg

 

 

 

 

여기서 우리는 SQL Procedure를 사용하여

country_name DATASET Country 변수가 갖는 나라명 리스트(중복이 없는 목록)를 갖는

하나의 매크로 변수(countries)를 생성하고자 합니다. 

 

 

SE22016091520494970.jpg

 

 

SE22016091520495970.jpg

 

나라명의 목록 countries 매크로변수에 할당된 것을 확인할 수 있습니다.

 

 

 

 

 

 

 

이상 SQL Procedure에서 

하나의 매크로 변수에 특정 컬럼의 값들을 저장하는 방법에 대해 살펴보았습니다.

 

 

감사합니다 ^^

  

Contributors
Version history
Last update:
‎06-16-2020 09:35 PM
Updated by:

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Article Labels
Article Tags