SAS Base, A00-211 Crambible, SAS 크램바이블

SAS 베이스 자격증, SAS 문제풀이 


QUESTION NO: 147


The following SAS program is submitted: 


data work.products;
Product_Number = 5461;
Item = '1001';


Item_Reference = Item'/'Product_Number;
run;

Which one of the following is the value of the variable ITEM_REFERENCE in the output data set?


A. 1001/5461
B. 1001/ 5461
C. . (missing numeric value)
D. The value can not be determined as the program fails to execute due to errors.


work라이브러리에 products라는 데이타에는 

Product_Number변수에는 5461값을 넣었고, Item 변수에는 1001 값을 넣었습니다. 참고로 item에는 따옴표가 들어있네요. 


item_Reference 에는 어떤 값이 들어가있을지 찾는 문제입니다. 


답이 B냐 D냐 말이 많은데요. SAS 프로그램을 돌려보면 되겠죠. 아래 그림처럼 에러가 뜹니다. 왜냐하면 item에 따옴표가 들어있어서 그래요. 그래서 결과값이 아무것도 나오지 않게 됩니다. 





1001/5461 로 넣고 싶으면 어떻게 하면 될까요?!!! 

Item_Reference 변수에다가 Item || '/'  || Pruduce_Number 로 하면 됩니다. 아래 이미지 참고하세요. 두 변수 값을 더해주게 됩니다. 




Answer: D 


반응형

+ Recent posts