1.6 Flashcards
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.
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;
True/False - The REPLACE option in the PROC EXPORT procedure tells SAS to overwrite the output file if it already exists.
True
Which of the following is NOT an option that can be used with the DBMS= option?
a) CSV
b) PDF
c) TAB
d) XLSX
b) PDF
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
d) All of the above
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;
True - The generic syntax for generating reports using ODS is:
ODS ;
/SAS code that produces output/
ODSCLOSE;
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=
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;
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) Rich Text Format
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
e) a, b, & d
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.
True
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
c) The level of expansion of the table of contents in PDF documents.
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.
d) Neither is correct. BOTH include FILE= not OUTFILE=
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.
d) Is false - The OUTFILE= option specifies the path and filename of the external datafile being created.
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;
b) proc export data=sashelp.cars dbms=csv outfile=”c:\temp\cars.txt”; run;