Q. Suppose you do not specify the LIBRARY=option and your formats are stored in Work.Formats. How lonw do the exist?
- only for the current SAS session.
- If you do not specift the LIBRARY=option, formats are stored in a default format catalog named Work.Formats.
- The libref Work signifies that any format that is stored in Work.Formats is a temporary format;
- it exists only for the current SAS session.
- defualt format catalog : Work.Formats
Q. Which of the following statements store your format in a permanent catalog.
- format 을 permanent catalog 에 저장하기 -
libname formtlib 'C:\Users\Student1\sas\formats\lib'; ----------------→ LIBNAME statement
proc format lib=formtlib ----------------→ lib=option
... ;
- To store formats in an permanent catalog, you first write a LIBNAME statement to associate the libref with the SAS data library in which the catalog will be stored.
- Then add the LIB= (or LIBRARY =) option to the PROC FORMAT statement, specifying the name of the catalog.
- LIBNAME statement 를 사용
- PROC FORMAT 문에 LIB= (또는 LIBRARY=) option 을 사용
[ 틀린코드 ]
a.
llibname formtlib 'C:\Users\Student1\sas\formats\lib';
format lib=formtlib
... ;
b.
formtlib = 'C:\Users\Student1\sas\formats\lib';
proc format formtlib
... ;
c.
formtlib = 'C:\Users\Student1\sas\formats\lib';
proc formtlib
... ;
Q. When you create a format with the VALUE statement, the new format's name cannot end with a number, cannot end with a period, and cannot be the name of a SAS format. Which of the following alse true?
- 포멧 이름 설정 규칙 -
- The name must begin with a dollar sign ($) if used with a character variable.
- The name of a format that is created with VALUE statement must begin with a dollar sign ($) if it applies to a character variable.
VALUE statement 를 사용하여 format을 생성할 때, format name 주의사항
- The name cannot end with a number.
- The name cannot end with a period.
- The name cannot be the name of a SAS format.
- The name must begin with a dollar sign if used with a character variable.
[ 틀린 보기 ]
- The name cannot be the name of a data set variable.
- The name must be at least two characters long.
- The name must be at least eight characters long.
Q. Which of the following FORMAT procedures written correctly?
- VALUE statement -
proc format lib=formtlib;
value colorfmt ---------------→ keyword VALUE
1= 'Red' ---------------→ label
2 = 'Green'
3 = 'Blue' ;
- A semicolon is needed after the PROC FORMAT statement.
- The VALUE statement begins with the keyword VALUE and ends with a semicolon after all the labels have been defined
- VALUE statement 는 keyword value 로 시작하고 모든 라벨값들이 정의된 후에 세미콜론으로 끝난다.
[ 틀린 보기 ]
a.
proc format lib=formtlib
value colorfmt;
1= 'Red'
2 = 'Green'
3 = 'Blue'
b.
proc format lib=formtlib;
value colorfmt;
1= 'Red'
2 = 'Green'
3 = 'Blue'
c.
proc format lib=formtlib;
value colorfmt
1= 'Red';
2 = 'Green';
3 = 'Blue' ;
Q. Which of these statement is false regarding what the ranges in the VALUE statement can specify?
- They can specify a single value, such as 25 or 'S' ( O )
- a range of numeric values, such as 0-1500 ( O )
- a range of character values, such as 'A' - 'M' ( O )
- a list of numeric and character values separated by commas, such as 90,'B',180,'D',270 ( X )

- You can list values separated by commas, but the list must contain either all numeric values or character values.
- Data set variables are either numeric or chrarater.
Q. How many characters can be used in a label? (32,767)
- Label -
- When specifing a label, enclose it in quotation marks and limit the label to 32,767 characters.
- 라벨을 정의할 때 ' ' 안에 값이 있어야 하며, 32,767 개의 문자를 사용할 수 있다.
Q. Which keyword can be used to label missing numeric values as well as any values that are not specified in a range?
( OTHER )
- The keyword OTER can be used in the VALUE statement to label missing values as well as any values that are not specifically included in a range.
[ 틀린 보기 ]
- LOW --------→ missing numeric value를 포함하지 않음
- MISS
- MISSING
- MISS and MISSING are invalid keywords, and LOW does not include missing numeric values.
Q. You can place the FORMAT statement in either a DATA step or a PROC step. What happens when you place it in a DATA step?
- FORMAT 을 DATA step 에 사용했을 때 -
- You permanently associate the formats with variables.
- By placing the FORMAT statement in a DATA step, you permanently associate the defined format with a variables.
- FORMAT 을 DATA step 에 사용했을 때, 영구적으로 associate 한다 !
[ 틀린 보기 ]
- You temporarily associate the formats with variables. ( X )
- You replace the original data with the formay labels. ( X )
- You make the formats available to other data sets. ( X )
Q. Suppose the format JOBFMT was created in a FORMAT procedure. Which FORMAT statement applies it to the variable JobTitle in the program output?
- FORMAT statement 에서 User-defined format 사용 -
- format jobtitle fobfmt.;
- To associate a user-defined format with a variable, place a period at the end of the format name when it is used in the FORMAT statement.
Q. Which keyword, when added to the PROC FORMAT statement, displays all the formats in your catalog?
( FMTLIB )
- Adding the keyword FMTLIB to the PROC FORMAT statment displays a list of all the formats in your catalog, along with descriptions of their values.
- PROC FORMAT 문에 FMTLIB keyword 를 추가하면, catalog 에 있는 모든 format의 리스트와 그 값들의 descriptions 을 보여준다.
'자격증 > SAS BASE' 카테고리의 다른 글
| Chapter 14. Using Function to Manipulate Date (0) | 2022.12.20 |
|---|---|
| Chapter 13. SAS Date, Time, ane Datetime Values. (0) | 2022.12.19 |
| Chapter 11 . Processing Data with Do Loops (0) | 2022.12.17 |
| Chapter 9. Creating and Managing Variables (0) | 2022.12.12 |
| Chapter 7. Understanding DATA Step Processing (1) | 2022.12.12 |