1.6 Flashcards

1
Q

Which of the following is NOT true regarding the PROC Export procedure?
a) In the PROC EXPORT statement, the DATA= option specifies the input table.
b) In the PROC EXPORT statement, the OUTFILE= option specifies the full path and file name of the exported datafile.
c) The correct syntax to output a data set is:
output out=MyData;
d) The DBMS= option tells SAS how to format the output.

A

c) The correct syntax to output a data set is:
output out=MyData;

The correct PROC EXPORT syntax is:

PROC EXPORT DATA=input-table OUTFILE=”output-file” “ “;
RUN;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True/False - The REPLACE option in the PROC EXPORT procedure tells SAS to overwrite the output file if it already exists.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following is NOT an option that can be used with the DBMS= option?

a) CSV
b) PDF
c) TAB
d) XLSX

A

b) PDF

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following are true regarding SAS ODS?

a) ODS stands for Output Delivery System
b) SAS ODS makes it simple to automate the entire process of exporting reports to other formats
c) XLSX, RTF, PDF and PPTX are all valid ODS destinations
d) All of the above

A

d) All of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

True/False - The following program will generate a file
in .csv format?

ods csvall file="&outputpath/cars.csv";
proc print data=sashelp.cars noobs;
   var Make Model Type MSRP MPG_City MPG_Highway;
   format MSRP dollar8.;
run;
ods csvall close;
A

True - The generic syntax for generating reports using ODS is:

ODS ;

/SAS code that produces output/

ODSCLOSE;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What option can you use in an ODS EXCEL statement to specify how you want your output to look?

a) FORMAT=
b) STYLE=
c) TEMPLATE=
d) SHEET_NAME=

A

b) You can specify a style for the output by using the STYLE= option and specifying one of the many different styles that are built into SAS. The following code will list all available style options.

proc template;
list styles;
run;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which ODS destination is a software-agnostic file type that’s made for word processing programs such as Microsoft Word?

a) RTF
b) DBF
c) WK1
d) DLM

A

a) Rich Text Format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following are required to write data to a new or existing Excel workbook?

a) XLSX engine requires a license for SAS/ACCESS to PC files
b) Use the LIBNAME statement to assign a libref pointing to the Excel file.
c) Use the SET statement to write to the appropriate Excel file.
d) Use the libref when naming output tables. The table name is the worksheet label in the Excel file.
e) a, b, & d

A

e) a, b, & d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True/False - The ODS EXCEL destination creates an .XLSX file. By default, each procedure output is written to a separate worksheet with a default worksheet name. The default style is also applied.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the PDFTOC=n option control in the ODS PDF?

a) The procedure label
b) The default style
c) The level of expansion of the table of contents in PDF documents
d) The start page of the pdf document that is generated

A

c) The level of expansion of the table of contents in PDF documents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following is the correct syntax for exporting in EXCEL and PDF formats?

ODS EXCEL OUTFILE="filename.xlsx" STYLE=style OPTIONS(SHEET_NAME='label');
/*SAS procedure*/
ODS EXCEL OPTIONS(SHEET_NAME='label');
/*SAS procedure*/
ODS EXCEL  CLOSE;

ODS PDF OUTFILE=”filename.pdf” STYLE=style STARTPAGE=NO PDFTOC=1;
ODS PROCLABEL “label”;
/SAS code that produces output/
ODS PDF CLOSE;

a) Both are correct
b) The EXCEL statements are correct, but the PDF statement will error.
c) The PDF statement is correct, but the EXCEL statement will error.
d) Neither is correct.

A

d) Neither is correct. BOTH include FILE= not OUTFILE=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which statement is false concerning options for the PROC EXPORT statement?

a) The DATA= option identifies the input SAS table.
b) The REPLACE option specifies to overwrite an existing file.
c) The DBMS= option specifies the database identifier for the type of file being created.
d) The OUT= option specifies the path and file name of the external data file being created.

A

d) Is false - The OUTFILE= option specifies the path and filename of the external datafile being created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which PROC EXPORT step contains valid syntax?

a) proc export outfile=”c:\temp\cars.txt” tab data=sashelp.cars replace; run;
b) proc export data=sashelp.cars dbms=csv outfile=”c:\temp\cars.txt”; run;
c) proc export data=sashelp.cars; dbms=csv; outfile=”c:\temp\cars.txt”; run;
a) proc export dbms=tab data=sashelp.cars replace=yes outfile=”c:\temp\cars.txt|; run;

A

b) proc export data=sashelp.cars dbms=csv outfile=”c:\temp\cars.txt”; run;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly