BookmarkSubscribeRSS Feed

SAS Ceritified Advanced Programmer 덤프 풀이 65-67

Started ‎06-15-2020 by
Modified ‎06-15-2020 by
Views 114

65. The variable attributes of SAS data sets ONE and TWO are shown below:

 

65-1.png

 

Data set ONE contains 100 observations. Data set TWO contains 50 observations. Both data sets are sorted by the variable YEAR.

The following SAS program is submitted:

 

data three;

merge one two;

by year;

run;

 

A. No messages are written to the SAS log.

B. ERROR and WARNING messages are written to the SAS log.

C. Data set THREE is created with two variables and 50 observations.

D. Data set THREE is created with three variables and 100 observations.

 

 

[정답] B

[풀이]

Merge는 단순 가로대응결합으로 data set의 공통변수의 값을 기준으로 행 병합을 합니다.

Mergeansdp dlTsms 각 입력 데이터세트는 BY문장의 변수를 기준으로 정렬합니다.

문제에서는 변수명이 아니라 값(year)로 기준을 삼아서 에러문이 뜹니다. 

 

[코드]

 

SE22020031116014270.png

 

[올바른코드]

 

SE22020031116015670.png

 

 

[결과값]

 

 

SE22020031116022170.png

 

  1. The following SAS program is submitted:

 

data new (bufsize = 6144 bufno = 4);

set old;

run;

 

 

 

Which one of the following describes the difference between the usage of BUFSIZE= and BUFNO= options?

A. BUFSIZE= specifies the size of the input buffer in bytes; BUFNO= specifies the number of input buffers.

B. BUFSIZE= specifies the size of the output buffer in bytes; BUFNO= specifies the number of output buffers.

C. BUFSIZE= specifies the size of the output buffer in kilobytes; BUFNO= specifies the number of input buffers.

D. BUFSIZE= specifies the size of the output buffer in kilobytes; BUFNO= specifies the number of output buffers.

 

 

[정답] B

[풀이]

BUFSIZE는 출력 버퍼의 크기를 바이트 단위로 지정합니다.

BUFNO는 출력 버퍼 수를 지정합니다.

 

 

 

 

  1. At the start of a new SAS session; the following program is submitted:

 

%macro one;

data _null_;

call symput('proc','means');

run;

proc &proc data=sashelp.class;

run;

%mend;

%one

 

What is the result?

 

A. The marco variable PRCO is stored in the SAS catalog WORK.SASMACR

B. The program fails to execute because PROC is a reserved word

C. The macro variable PROC is stored in the local symbol table

D. The macro variable PROC is stored in the global symbol table

 

 

 

[정답]D

[풀이]

Global Symbol Table 에서의 Macro Variables

  • SAS 세션이 시작할 때 초기화됩니다.
  • Automatic or System-defined Macro Variables 가 초기화 됩니다.
  • SAS 세션이 끝날 때 delete 됩니다.

Global Macro Variable 를 생성하려면

  • %LET 문장(used outside a macro definition)
  • DATA step 에서의 SYMPUT 사용
  • PROC SQL  INTO 
  • %GLOBAL 문장

매크로에서는 변수의 이름에는 ‘&’가 붙고 매크로 이름에는 %가 붙습니다.

CALL SYMPUT(“저장할 매크로 이름”, 값);

이와 반대로 LOCAL SYMBOL TABLE이 있으며, 매크로 문장 내에서 parameter list를 지정했을 때나, 매크로 실행동안 생성되며, 매크로 실행이 끝나면 삭제됩니다.

 

[코드]

 

SE22020031116045870.png

 

[결과]

 

SE22020031116050970.png

Version history
Last update:
‎06-15-2020 05:50 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