




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































existing SAS data set? A. PROC DATA B. DATA data=... C. SET D. DATA Answer: D Explanation:
create. The SET statement is used inside the DATA step to read the observations from an existing data set, but the statement that begins the creation of a new data set is DATA. For example:
A. A valid FILENAME statement B. A user-assigned library reference (LIBNAME) C. The WORK library reference D. The ODS statement Answer: B Explanation:
the temporary WORK library. This requires assigning a library reference (LIBNAME) to a permanent folder/directory.
in the library mylib from an existing data set work.staff? A. sas Copy DATA employees; SET mylib.staff; RUN; B. sas Copy DATA mylib.employees; SET work.staff;
RUN; C. sas Copy DATA work.mylib.employees; SET staff; RUN; D. sas Copy DATA mylib_work.employees; SET staff; RUN; Answer: B Explanation:
The SET statement reads from work.staff, and the newly created data set is in the mylib library.
stores it in which library? A. USER B. WORK C. PERM D. TEMP Answer: B Explanation:
temporary WORK library, which is deleted at the end of the SAS session.
want to copy data from an existing data set? A. Right before the RUN; statement B. After the DATA statement and before other statements C. Anywhere in the DATA step D. It cannot be used in the same DATA step as other statements
WORK library unless otherwise specified. The SET mydata.staff; reads from the permanent library mydata, but the output (employees) is in WORK.
level name in the SET statement? A. It will convert the input data set into a temporary data set automatically. B. It will produce an error message and the code will not execute. C. It will produce a permanent data set while reading from a temporary one. D. It will produce a temporary data set while reading from a permanent one. Answer: C Explanation:
permanent data set in mylib, while specifying a one-level name (e.g., oldds) in the SET statement points to the default WORK.oldds. This means you read from a temporary data set and write to a permanent one.
A. It requires a LIBNAME statement to be referenced. B. It does not exist unless you create it manually. C. It is automatically created at the start of the session and deleted at the end. D. It stores only logs and output files. Answer: C Explanation:
of a session and removed at session termination.
name of region, how should it be referred to in a DATA step? A. sales.region.sas7bdat B. sales(region) C. region.sales D. sales.region Answer: D Explanation:
automatically appends the .sas7bdat extension for datasets in most environments.
A. It creates a new data set in the WORK library. B. It overwrites the existing mylib.emps data set with the same data. C. It renames mylib.emps to emps2 in the same library. D. It produces an error since you can't read and write the same data set simultaneously. Answer: B Explanation:
the SET statement overwrites the existing data set with the new data (which, in this case, is identical unless additional statements modify it).
WORK library from an existing data set mylib.source_data? A. sas Copy DATA WORK.mylib.temp_data; SET source_data; RUN; B. sas Copy DATA mylib.temp_data; SET WORK.source_data; RUN; C. sas Copy DATA temp_data; SET mylib.source_data; RUN; D. sas
A. Use a DATA statement without the SET statement. B. Place all attribute-related statements (e.g., LENGTH, FORMAT, etc.) before the SET statement. C. Use PROC CONTENTS to change attributes. D. Use PROC APPEND to finalize changes. Answer: B Explanation:
them to take effect in the output data set during that DATA step.
DATA step? A. To rename the dataset to something more meaningful B. To add new observations or modify existing variables C. To delete the dataset from the disk D. Overwriting permanent data sets is not allowed in SAS Answer: B Explanation:
information. However, caution should be used since it destroys the original data set.
the following could be a valid statement in a DATA step? A. DATA testlib dataset; SET olddata; B. DATA testlib.olddata; C. DATA testlib.newset; SET olddata; D. DATA newset.testlib; Answer: C Explanation:
olddata can reference a one-level name if olddata is in the WORK library or another two-level name if it is in a different library.
library, which is the simplest code snippet? A. sas Copy LIBNAME WORK 'C:\temp'; DATA class_subset; SET WORK.class; RUN; B. sas Copy DATA class_subset; SET sashelp.class; RUN; C. sas Copy DATA WORK.class_subset; SET class; RUN; D. sas Copy DATA class_subset; SET class; RUN; Answer: B Explanation:
(class_subset) stores the output in WORK.class_subset. This is the simplest code.
permanent SAS data set? A. Checking available disk space in the target library location B. Adding relevant LABEL or FORMAT statements to clarify data C. Including a KEEP= or DROP= data set option if needed D. Saving the data set to the WORK library
Answer: A Explanation:
named mylib to the directory C:\Data.
sas Copy LIBNAME sales CLEAR; B. sas Copy FILENAME sales CLEAR; C. sas Copy PROC CLEAR lib=sales; RUN; D. sas Copy LIBFILE sales CLEAR; Answer: A Explanation:
attributes (e.g., creation date, variables)? A. PROC FREQ B. PROC UNIVARIATE C. PROC CONTENTS D. PROC PRINT
Answer: C Explanation:
including variable attributes, the number of observations, and more.
data sets in the mylib library? A. sas Copy PROC CONTENTS DATA=mylib.ALL NODS; RUN; B. sas Copy PROC CONTENTS DATA=mylib; RUN; C. sas Copy PROC CONTENTS DATA='mylib'; RUN; D. sas Copy PROC CONTENTS LIBNAME=mylib ALL; RUN; Answer: A Explanation:
mylib library. The NODS option suppresses the detailed descriptor for each data set, providing a succinct summary.
primary piece of information you will not see by default? A. Number of observations in each data set
you can check which of the following? A. The SAS log after submitting a LIBNAME statement B. The SASHELP.VTABLE view C. The PROC CONTENTS NODS listing D. The PROC PRINT output of the library Answer: A Explanation:
path associated with that libref. You can also query SASHELP.VLIBNAM to see library assignments, but the simplest place to check is the SAS log.
exist? A. SAS creates the folder automatically. B. SAS displays an error in the log, and the libref is not assigned. C. SAS assigns the libref to the closest existing directory. D. The session hangs indefinitely. Answer: B Explanation:
log and does not assign the library reference.
A. You cannot use it on the WORK library. B. It provides a listing of the data itself, including observation-level data. C. It only works on permanent libraries. D. It describes the structure (descriptor portion) of the data sets. Answer: D Explanation:
variable names, lengths, labels, creation date, and so on, not the actual data values.
which procedure is most efficient? A. PROC FREQ B. PROC PRINT C. PROC CONTENTS D. PROC SQL Answer: C Explanation:
correct? A. It displays only numeric variables by default. B. It shows the file format (e.g., .xlsx, .csv) that the data set was sourced from. C. It displays variable type, length, label, and format for each variable. D. It automatically sorts the variables by name or label. Answer: C Explanation:
It does not indicate the original file format.
showing detailed variable attributes for each data set? A. sas Copy PROC CONTENTS DATA=mylib.ALL; RUN; B. sas Copy PROC CONTENTS DATA=mylib.ALL NODS; RUN; C. sas Copy
the data, which approach might you use? A. PROC PRINT DATA=mylib.sales (OBS=0); B. PROC SQL; SELECT COUNT(*) FROM mylib.sales; QUIT; C. PROC CONTENTS DATA=mylib.sales; RUN; D. Any of the above Answer: D Explanation:
them: o PROC PRINT DATA=mylib.sales (OBS=0) shows dataset attributes (including # of observations) but does not print rows. o PROC SQL; SELECT COUNT(*) returns the row count. o PROC CONTENTS shows the number of observations in the metadata.
sets, such as class? A. WORK B. SASHELP C. MAPS D. USER Answer: B Explanation:
sample data sets and utility files.
library reference every session, you can: A. Add the LIBNAME statement to the Autoexec file. B. Use a macro variable that references the path. C. Use the WORK library for permanent storage. D. Manually assign the libref each time you start SAS. Answer: A Explanation:
the start of each SAS session, ensuring a permanent library is always assigned.
has no data sets? A. It produces an error message and stops. B. It displays a note in the log that there are no data sets in the library. C. It automatically creates a new data set called ALL. D. SAS tries to create an empty data set in mylib. Answer: B Explanation:
exist and no contents are displayed.
A. Using forward slashes on some operating systems B. The directory path does not exist or is misspelled C. Using an 8-character libref with uppercase letters D. Specifying the library reference as the first statement in the session Answer: B Explanation:
using forward slashes or an 8-character name) typically do not cause errors (depending on OS).
Answer: B Explanation:
of the same name if it already exists? A. REWRITE B. OVERWRITE C. REPLACE D. DELETE Answer: C Explanation:
name is overwritten.
is correct? A. You must save the Excel file as a CSV first. B. The XLSX engine can directly read .xlsx files without using PROC IMPORT. C. It only works on Unix-based systems. D. It cannot access multiple sheets in the workbook. Answer: B Explanation:
using a LIBNAME statement, bypassing the need for PROC IMPORT.
Excel workbook C:\Data\report.xlsx using the XLSX engine? A. sas Copy LIBNAME exceldata XLSX 'C:\Data\report.xlsx'; B. sas Copy LIBNAME exceldata 'C:\Data\report.xlsx' ENGINE=XLSX; C.
sas Copy LIBNAME exceldata 'C:\Data\report.xlsx' DBMS=XLSX; D. sas Copy FILENAME exceldata XLSX 'C:\Data\report.xlsx'; Answer: A Explanation:
tells SAS to treat the Excel file as a library with the XLSX engine.
reference a specific sheet named Sheet1 as a SAS data set? A. exceldata.Sheet1.sas7bdat B. exceldata."Sheet1"$ C. exceldata.'Sheet1$' D. exceldata.Sheet1$ Answer: D Explanation:
the sheet name: libref.SheetName$. If the sheet name has spaces, you would need quotes, e.g., exceldata.'My Sheet$'n.
true? A. You can use PROC CONTENTS to view the column metadata of the Excel sheet. B. You can filter rows using a WHERE statement in a DATA step. C. You can update data in the Excel file if you have write access. D. The Excel sheet is treated exactly like a native SAS dataset, including full indexing support. Answer: D Explanation:
set, not all SAS dataset features (like indexing) are fully supported for Excel files.