BookmarkSubscribeRSS Feed

INPUT 문

Started ‎10-26-2021 by
Modified ‎10-26-2021 by
Views 235
  • raw data file 의 값을 해당 SAS 변수에 할당하는 방법을 명시.
  • List input / formatted input / column input 등이 있음.

INPUT specifications ;

 

  • List input : 구분자로 구분된 raw data file 일 경우 사용.

 

List input

특징

INPUT 변수 <$> ;

-   비표준 데이터 처리 불가능.

-   문자 변수 길이가 8byte.

INPUT 변수 < : informat > ;

- 비표준 데이터 처리 가능.

 

※ 표준/비표준 데이터란?

표준 숫자 데이터: 15 -15.4 00.99   1.23E3   -1.23E-3

비표준 숫자 데이터: 12,345 (23) $3,456.0   1960-01-01

 

※ 입력형식(informat)

  • raw data 를 어떻게 읽어올 지를 지시.
  • 변수의 타입과 길이도 결정.

<$><informat><w>.<d>

$

문자타입, 생략시 숫자타입.

informat

비표준 데이터일 경우 사용.

w

읽을 총 자리수.

 

d

처리할 소수점 자리수.

숫자일 경우 사용할 수는 있으나 읽은 숫자 내에 소수점이 있을 경우 무시됨.

 

◀예제▶ 입력형식 예시

Raw data

value

 

입력형식

SAS 변수

유형과 길이

12345.6

7.

12345.6

숫자 8

홍길동

$6.

홍길동

문자 6

홍길동

$10.

홍길동

문자 10

12,345.67

comma9.

12345.67

숫자 8

01/01/1960

yymmdd10.

0

숫자 8

Contributors
Version history
Last update:
‎10-26-2021 04:43 AM
Updated by:

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Article Labels
Article Tags