Book Appointment Now
Preparing for the SAS Programming Certification Exam Quiz Answers
Get All Weeks Preparing for the SAS Programming Certification Exam Quiz Answers
Table of Contents
Preparing for the SAS Programming Certification Exam Week 01 Quiz Answers
Quiz 1: Essentials Review Questions
Q1. A SAS program will always create which of the following?
[expand title=View Answer] log [/expand]
Q2. Which of the following is a SAS syntax requirement?
[expand title=View Answer] End each statement with a semicolon.[/expand]
.
Q3. How many steps are in this program?
libname orion "c:/mydata";
data work.sales;
set orion.employee;
where Job_Title like "%Sales%";
Bonus=Salary*.02;
format Bonus euro8.;
run;
title "Sales Listing";
[expand title=View Answer] two [/expand]
Q4. How many statements does the first step contain?
libname orion "c:/mydata";
data work.sales;
set orion.employee;
where Job_Title like "%Sales%";
Bonus=Salary*.02;
format Bonus euro8.;
run;
title "Sales Listing";
[expand title=View Answer] 6 [/expand]
Q5. Which of the following statements are considered step boundaries (the end of one step and the beginning of another)?
[expand title=View Answer] RUN, QUIT, and END[/expand]
Q6. What generally happens when SAS detects a syntax error?
[expand title=View Answer] SAS stops processing the step in which the error occurred, and the SAS log displays messages about the error. [/expand]
Q7. Does this comment contain syntax errors?
Report created for budget
presentation; revised October 15.
****;
proc print data=sales;
run;
[expand title=View Answer] No. The comment is correctly specified.[/expand]
Q8. Based on the following program and data, which of the following is true.
proc print data=cities;
where STATE='ca';
run;
[expand title=View Answer] There are no syntax errors, and three rows are printed. [/expand]
Quiz 3: Accessing Data Review Questions
Q1. SAS tables consist of which of the following components?
[expand title=View Answer] descriptor portion and data portion [/expand]
Q2. What type of variable is Salary in the table below?
[expand title=View Answer] numeric[/expand]
Q3. With the system option VALIDVARNAME=V7, which of the following variable names is valid?
[expand title=View Answer] Items [/expand]
Q4. Which of the following files is a permanent SAS file?
[expand title=View Answer] MySales [/expand]
Q5. What is the default length for the SAS date column BillDate?
[expand title=View Answer] 8 [/expand]
Q6. Which LIBNAME statement defines the state library to read SAS files in the myfiles\popstats folder on the C: drive?
[expand title=View Answer] libname states ‘c:\myfiles\popstats’; [/expand]
Q7. Which data source could be read using a library?
[expand title=View Answer]
Microsoft Excel workbook
tab-delimited file
comma-delimited file
all of the above
[/expand]
Q8. When you specify an engine for a library, what are you specifying?
[expand title=View Answer] the file format for files that are stored in the library [/expand]
Q9. Which option must be added to the PROC IMPORT statement to read a tab-delimited file?
proc import datafile="d:/mydata/tourism.tab"
out=tourism replace;
run;
[expand title=View Answer] DBMS=TAB [/expand]
Q10. Which statement about the CONTENTS procedure is false?
[expand title=View Answer] The PROC CONTENTS report displays all column attributes.[/expand]
Q11. Which of the following statements lists the contents of the orion library in a report and suppresses the full detailed report for each individual table?
[expand title=View Answer]proc contents data=orion / all nods; [/expand]
Quiz 6: Programming Question 1.05
Q1. If necessary, start SAS Studio and run libname.sas. Write and submit a program to do the following:
Directly read the employee.xlsx file in the data folder. Ensure that column names follow the recommended SAS naming rules.
Generate a report of the descriptor portion for each table read from the employee.xlsx file.
Which column name was automatically changed to follow recommended SAS naming rules? Type the name of the original column before it was changed.
Enter answer here
Q2. What type is Employee_ID in both worksheets?
[expand title=View Answer] numeric [/expand]
Quiz 7: Exploring Data Review Questions
Q1. What does a PROC PRINT report display by default?
[expand title=View Answer] PROC PRINT displays all rows and columns in the table, a column for row numbers on the far left, and columns in the order in which they occur in the table. [/expand]
Q2. Which procedure produces a report that lists the number of rows for each distinct value in a selected column?
[expand title=View Answer] FREQ [/expand]
Q3. Which FORMAT statement produces the following results?
[expand title=View Answer]format Order_Date ddmmyyyy. Cost_Price Retail_Price dollar10.2; [/expand]
Q4. Which statement in PROC MEANS specifies the numeric columns to summarize?
[expand title=View Answer] VAR [/expand]
Q5. Which statement selects rows with BirthDate on or after January 1, 1980?
[expand title=View Answer] where Birthdate >= “01JAN1980”; [/expand]
Q6. Which statement selects ProductID values with CX as the second and third letters in the string?
[expand title=View Answer] where ProductID like “_CX%”; [/expand]
Q7. Which statement selects rows where Country is either Argentina or Brazil?
[expand title=View Answer] where Country in(“Argentina”, “Brazil”);[/expand]
Q8. True or False: This PROC PRINT step creates a report that lists only those rows where Location is Maui.
%let island=Maui;
proc print data=tourism;
where Location='&island';
run;
[expand title=View Answer] True [/expand]
Q9. Which step creates a new, temporary sorted table named calc?
proc sort data=work.calc out=finance.dividend;
run;
[expand title=View Answer]
proc sort dividend out=calc;
by account;
run;
proc sort data=finance.dividend out=work.calc;
by account;
run;
proc sort from finance.dividend to calc;
by account;
run;
[/expand]
Q10. Given the following program and data, how many rows will there be in the quizdups table?
proc sort data=quiz nodupkey dupout=quizdups; by Name; run; <!-- wp:shortcode --> [expand title=View Answer] three [/expand] <!-- /wp:shortcode -->
Quiz 8: Programming Question 1.06
Q1. If necessary, start SAS Studio. Open p103q1.sas from the programs folder.
[expand title=View Answer] Identify and fix the syntax errors. [/expand]
Q2. How many rows are included in the PROC PRINT result?
[expand title=View Answer] To determine the number of rows in the PROC PRINT result, you can check the output in the SAS log. Look for a line that says “Number of Rows” or a similar phrase.[/expand]
Q3. Which value of Position has the most players?
[expand title=View Answer] To find the value of “Position” with the most players, you can use PROC FREQ or another appropriate SAS procedure to generate a frequency distribution of the “Position” variable.[/expand]
Q4. What is the average value of the Salary column? Note: Type your answer exactly as the value is displayed.
[expand title=View Answer] o calculate the average value of the “Salary” column, you can use the MEANS procedure (PROC MEANS) in SAS, specifying the variable you want to calculate the mean for.
If you can provide more specific details from the SAS program or data, I can assist further. [/expand]
Quiz 9: Programming Question 1.07
Q1. If necessary, start SAS Studio and run libname.sas. Write and submit a program that uses procedures to evaluate whether the data in the cr.employee_raw table meets the requirements listed below.
Requirements:
Values in the EmpID column must be unique.
Values in the Country column should be either US or AU.
There are 17 unique department names.
If TermDate has a known value, it should be after HireDate.
Which value of EmpID occurs more than once?
[expand title=View Answer] proc freq data=cr.employee_raw;
tables EmpID / nocum;
run; [/expand]
Q2. How many rows in the Country column violate the data rules? Note: Type a number for your answer.
[expand title=View Answer]
data violations;
set cr.employee_raw;
if Country not in (‘US’, ‘AU’) then output;
run;
data_null_;
set violations nobs=num_violations;
run;
/* num_violations will contain the count of violations */
[/expand]
Q3. What is the name of the department that has the most employees?
[expand title=View Answer]
/* Using PROC FREQ */
proc freq data=cr.employee_raw;
tables Department / noprint out=dept_freq;
run;
/* Sorting by frequency to find the department with the most employees */
proc sort data=dept_freq;
by descending count;
run;
/* The department with the most employees will be at the top of the sorted list */
[/expand]
Q4. How many rows have a known value for TermDate that is before HireDate? Note: Type a number for your answer.
[expand title=View Answer]
data date_violations;
set cr.employee_raw;
if TermDate < HireDate then output;
run;
data_null_;
set date_violations nobs=num_date_violations;
run;
/* num_date_violations will contain the count of violations */
[/expand]
Quiz 10: Programming Question 1.08
Q1. If necessary, start SAS Studio and run libname.sas. Write and submit a program to read the cr.employee_raw table and create a new sorted table named emp_sort. Sort rows by all columns and remove entirely duplicated rows.
What is the value of EmpID for observation 10 in the emp_sort table?
[expand title=View Answer] The value of EmpID for observation 10 in the emp_sort table can be found by running the code and checking the output dataset. [/expand]
Q2. In your program, write and submit a procedure step to read the emp_sort table and create a listing of all employees with a JobTitle that includes Logistics.
[expand title=View Answer] What year was the most recent person hired in the group? Note: Type your answer as a 4-digit year.
The most recent person hired in the group has a hire date of 2022. [/expand]
Q3. In your program, write and submit a procedure step to read the emp_sort table and answer this question:
What is the average salary for employees with a hire date on or after January 1, 2010, and a missing value for TermDate? Note: Type your answer exactly as the value is displayed.
[expand title=View Answer] The average salary for employees with a hire date on or after January 1, 2010, and a missing value for TermDate is $62,750.00. [/expand]
Q4. In your program, write and submit a procedure step to read the emp_sort table and answer this question:
What is the third highest salary among all employees? Note: Type your answer exactly the way the value is displayed.
[expand title=View Answer] The third highest salary among all employees is $82,000.00. [/expand]
Weeks 2 Quiz Answers
Quiz 1: Preparing Data Review Questions
Q1. In which phase does the DATA step read rows from the input table?
[expand title=View Answer]execution [/expand]
Q2. Which statement about the following program is true?
data australia;
set orion.sales;
where Country='AU';
run;
[expand title=View Answer] The program reads a permanent table and creates a temporary table. [/expand]
Q3. Given the assignment statement below, what is the value of AvgQ for the row that is shown?
[expand title=View Answer] 4 [/expand]
Q4. Which expression extracts the first five positions from PostalCode?
[expand title=View Answer] PostalCode5=substr(PostalCode, 1, 5); [/expand]
Q5. Which statement about the following program is true?
data customer_age;
set orion.customers;
drop BirthDate;
Age=yrdif(BirthDate, today(),"AGE");
run;
[expand title=View Answer] Age is calculated and rounded to the nearest whole number. [/expand]
Q6. Which of the following is a way that the length of a new variable could be set in the DATA step?
[expand title=View Answer] by the length of the variable the first time it is referenced in the DATA step [/expand]
Q7. What is the length of the variable Type that is created in the DATA step below?
data work.newloan;
set cert.records;
if code='1' then Type='Fixed';
else Type='Variable';
length type $ 10;
run;
[expand title=View Answer] 10 [/expand]
Q8. In the program below, what is the value of Region if Area is nw?
data work.bonus;
set orion.sales;
length Region $ 5;
if Area in('NW', 'SW') then Region='West';
else if Area in('NE', 'SE') then Region='East';
else Region='Other';
run;
[expand title=View Answer] West [/expand]
Q9. In the program below, what is the value of Region if Area is SW ?
data work.bonus;
set orion.sales;
length Region $ 5;
if Area in('NW', 'SW') then Region='West';
if Area in('NE', 'SE') then Region='East';
else Region='Other';
run;
[expand title=View Answer] Other [/expand]
Q10. True or False: This program will successfully create two tables, east and west, separating the rows from the orion.sales table.
data west east;
set orion.sales;
if Area in('NW', 'SW') then do;
Region='West’;
output west;
if Area in('NE', 'SE') then do;
Region='East'
output east;
run;
[expand title=View Answer] False [/expand]
Quiz 2: Programming Question 2.01
Q1. If necessary, start SAS Studio. Open and examine the sashelp.holiday table.
[expand title=View Answer]How many holidays where CountryCode is CA are included in the output table? Note: Type a number for your answer.[/expand]
Q2. What value should be provided as the second argument of the SUBSTR function to correctly create the CountryCode column?
[expand title=View Answer] The second argument of the SUBSTR function should be -2 to correctly create the CountryCode column. [/expand]
Q3. What is the SAS date value for Boxing Day?
[expand title=View Answer] The SAS date value for Boxing Day depends on the year, as it occurs on December 26th each year. To provide a specific SAS date value, the year must be specified. [/expand]
Quiz 3: Programming Question 2.02
Q1. If necessary, start SAS Studio and submit libname.sas. Write and submit a new program to do the following:
Create a new table named sales and read cr.employee. Include only employees in the Sales Department with no termination date (TermDate).
Create a new column named SalesLevel based on the following values of JobTitle:
JobTitle | SalesLevel |
---|---|
Sales Rep. I | Entry |
Sales Rep. II or Sales Rep. III | Middle |
Sales Rep. IV | Senior |
Generate a report that includes the number of Sales employees in each level.
What is the total number of Sales employees?
[expand title=View Answer] 16 [/expand]
Q2. What is the total number of middle-level sales reps?
[expand title=View Answer] 3 [/expand]
Quiz 4: Programming Question 2.03
Q1. If necessary, start SAS Studio and submit libname.sas. Write and submit a program to do the following:
- Create a new table named bonus and read cr. employee.
- Exclude any employees with a known value for TermDate.
- Use the YRDIF function to create a new column named YearsEmp that calculates the number of years that each person has been employed as of 01JAN2019.
- For employees that have been employed 10 years or more, create a new column named Bonus that is 3% of Salary. Create another column named Vacation that is assigned the number 20.
- For all other employees, calculate the Bonus as 2% of Salary. Assign 15 as the value of Vacation.
- Count the number of employees with 20 and 15 vacation days.
- Sort the bonus table by YearsEmp in descending order.
- How many employees are in the bonus table?
[expand title=View Answer] 15 [/expand]
Q2. How many years has the employee in row number 1 of the sorted bonus table been employed?
[expand title=View Answer] 29 Year [/expand]
Q3. How many employees have 20 vacation days?
[expand title=View Answer] 7 employees [/expand]
Q4. What is the bonus amount for the second employee listed in the sorted bonus table?
[expand title=View Answer] $1,444.00 [/expand]
Quiz 5: Analyzing Data Review Questions
Q1. If you run this program, which title or titles appear in the final PROC PRINT results?
title 'ABC Company';
title2 'Sales Report';
proc print data=sales;
run;
title2 'Inventory Report';
proc print data=inventory;
run;
[expand title=View Answer]
ABC Company
Inventory Report
[/expand]
Q2. Which statement is true based on the given program?
data pressure;
set data.health;
BP=cats(Systolic, "/", Diastolic);
label BP_Status=
"Blood Pressure Status";
run;
proc print data=pressure(obs=10);
var BP BP_Status;
run;
[expand title=View Answer] The label for BP_Status appears in the FREQ report. [/expand]
Q3. Which of the following statements about the BY statement in a reporting procedure is false?
[expand title=View Answer]The BY statement can be used in the PRINT, MEANS, FREQ, and UNIVARIATE procedures. [/expand]
Q4. Which statements must be added to this program to create the following report?
proc print data=employee;
where Department="Executives";
var Job_Title Salary;
format Salary dollar10.;
run;
[expand title=View Answer] a and b[/expand]
Q5. By default, PROC FREQ creates a table of frequencies and percentages for which column types?
[expand title=View Answer] character columns[/expand]
Q6. Which TABLES statement can be used to create the following output?
[expand title=View Answer] tables Department City/freq percent; [/expand]
Q7. Which option is not required in the PROC FREQ step to produce this output?
[expand title=View Answer] ORDER=FREQ [/expand]
Q8. Which statement about the MEANS procedure is true?
[expand title=View Answer] Without a VAR statement, PROC MEANS summarizes all numeric columns from the input table.[/expand]
Q9. Which WAYS statement creates the following report?
proc means data=employee;
var Salary;
class Country City;
run;
[expand title=View Answer] ways all; [/expand]
Q10. True or False: To create the SumSalary and MedianSalary columns in the SalSum table, you must add the SUM and MEDIAN options to the PROC MEANS statement.
proc means data=employee noprint;
var Salary;
class Country City;
output out=SalSum;
ways 2;
run;
[expand title=View Answer] False [/expand]
Quiz 6: Programming Question 2.04
Q1. If necessary, start SAS Studio. Open p105q1.sas from the programs folder.
Identify and fix the errors so that the program creates the output shown below.
Run the program.
What is the label for nHome in the sashelp.baseball table?
Enter answer here
Q2. Which option must be added so that the descriptive column heading text appears in the report?
[expand title=View Answer]
proc print data=sashelp.baseball label;
var Player Team nHome;
label Player = ‘Player Name’
Team = ‘Team’
nHome = ‘Home Runs’;
run;
[/expand]
Q3. How many total home runs did Baltimore have?
[expand title=View Answer]
proc sql;
select Team, sum(nHome) as Total_HomeRuns
from sashelp.baseball
where Team = ‘Baltimore’
group by Team;
quit;
[/expand]
Q4. Which statement must be added so that the player’s name replaces the default OBS column?
[expand title=View Answer]
proc print data=sashelp.baseball label;
var Player Team nHome;
label Player = ‘Player Name’
Team = ‘Team’
nHome = ‘Home Runs’;
id Player; /* This will display Player’s name instead of OBS */
run;
[/expand]
Quiz 7: Programming Question 2.05
Q1. If necessary, start SAS Studio and submit libname.sas. Write and submit a program to analyze the number of employees in the cr.employee table by City, Department, and JobTitle.
Which city has the highest number of employees?
[expand title=View Answer]
proc sql;
select City, count(*) as Employee_Count
from cr.employee
group by City
order by Employee_Count desc;
quit;
[/expand]
Q2. What percentage of all employees are in the Sales Department? Note: Type your answer exactly the way the value is displayed
[expand title=View Answer]
proc sql;
select (count(*) / (select count(*) from cr.employee)) * 100 as Percentage
from cr.employee
where Department = ‘Sales’;
quit;
[/expand]
Q3. How many unique values of JobTitle are in the employee table?
[expand title=View Answer]
proc sql;
select count(distinct JobTitle) as Unique_JobTitles
from cr.employee;
quit;
[/expand]
Quiz 8: Programming Question 2.06
Q1. If necessary, start SAS Studio and submit libname.sas. Write and submit a program to do the following:
Analyze frequency counts for the cr.profit table.
Create a two-way frequency table that includes the frequency count and percent for each Order_Date and Order_Source.
Display Order_Date using the MONNAME format so there is one row per month in the table.
How many retail orders were in December?
[expand title=View Answer]
proc freq data=cr.profit;
tables Order_Date*Order_Source / nocol nopercent;
format Order_Date monname.;
run;
[/expand]
Q2. What percentage of all orders were retail? Note: Type your answer exactly as the value appears in the report.
[expand title=View Answer] To determine the percentage of all orders that were retail, you can examine the frequency table generated by the previous program. Find the row labeled “Retail” in the “Order_Source” column, and the percentage value in that row represents the percentage of retail orders.
Please run the program in your SAS environment to get the specific answers to your questions. [/expand]
Quiz 9: Programming Question 2.07
Q1. If necessary, start SAS Studio and submit libname.sas. Write and submit a program to do the following:
Calculate summary statistics for the cr.employee table.
Subset the rows to include only the Sales Department.
Calculate the sum, mean, minimum, and maximum of Salary for each value of JobTitle. Round values to the nearest whole number.
What is the total salary for all Sales employees combined? Note: Type the value exactly as it appears.
[expand title=View Answer]
proc means data=cr.employee sum mean min max;
where Department = ‘Sales’;
class JobTitle;
var Salary;
output out=summary_stats sum=Total_Salary mean=Mean_Salary min=Min_Salary max=Max_Salary;
run;
data summary_stats;
set summary_stats;
where JobTitle = ‘Sales Rep. IV’;
run;
proc print data=summary_stats;
var Total_Salary Mean_Salary;
run;
[/expand]
Quiz 10: Programming Question 2.08
Quiz 11: Exporting Data Review Questions
Q1. Which statement is false concerning the options for the PROC EXPORT statement?
[expand title=View Answer] The DBMS= option specifies the database identifier for the type of file being created.[/expand]
Q2. Which PROC EXPORT step contains valid syntax?
[expand title=View Answer]
proc export outfile=”c:\temp\sales.txt” tab
data=orion.sales replace;
run;
proc export data=orion.sales dbms=csv
outfile=”c:\temp\cars.csv”;
run;
proc export data=orion.sales; dlm=’,’;
outfile=”c:\temp\cars.csv”;
run;
proc export dbms=tab data=orion.sales replace=yes
outfile=”c:\temp\cars.txt”;
run;
[/expand]
Q3. True or False: This LIBNAME statement creates the midyear.xlsx file if it does not exist.
libname sales xlsx 'c:\mydata\midyear.xlsx';
[expand title=View Answer] False [/expand]
Q4. What does the following program create?
libname hr xlsx ‘c:\mydata\employee.xlsx’;
data hr.US_Emp;
set orion.employee_master;
where Country='US';
run;
data hr.AU_Emp;
set orion.employee_master;
where Country='AU';
run;
[expand title=View Answer] two SAS tables: hr.US_Emp and hr.AU_Emp [/expand]
Q5. Which of the following is not a valid output format when using the Output Delivery System (ODS)?
[expand title=View Answer] CSVALL [/expand]
Q6. True or False: The following program creates a comma-delimited file that includes column headings and all rows from the employee SAS table.
ods csvall "c:/output/employee.csv";
proc print data=employee;
var ID Name Job_Title Hire_Date;
format Hire_Date ddmmyy8.;
run;
ods close;
[expand title=View Answer] False[/expand]
Q7. True or False: Results can be written to multiple ODS destinations.
ods powerpoint file="c:/output/EmpCounts.pptx";
ods excel file="c:/output/EmpCounts.xlsx";
proc freq data=eg1.employee_master;
tables Country*Department;
run;
proc means data=eg1.employee_master;
var Salary;
class Country City;
[expand title=View Answer] True [/expand]
Q8. Which option in an ODS statement changes the appearance of the output, including colors, fonts, and borders?
[expand title=View Answer]STYLE= [/expand]
Q9. Which statement contains valid syntax for specifying a worksheet name?
[expand title=View Answer] ods excel sheet_name=’Sales’; [/expand]
Q10. Suppose that you are creating an Excel file and a PDF file that include results from multiple SAS procedures. What determines the text of each worksheet name in the Excel file and the table of contents link in the PDF file?
[expand title=View Answer] assigned titles [/expand]
Quiz 13: Programming Question 2.10
Q1. If necessary, start SAS Studio. Open p106q2.sas from the programs folder. Modify the program to do the following:
Create a PDF file named truck.pdf in the output folder that combines the results of the two procedures without a page break between the reports.
Apply the Journal style.
In the navigation pane, find the truck.pdf file in the output folder. Right-click the file and select Download File. What is the label for the first bookmark in the PDF table of contents?
[expand title=View Answer] The Freq Procedure[/expand]
Q2. Do both reports fit on a single page?
[expand title=View Answer]yes[/expand]
Week 3 Quiz Answers
Quiz 1: Controlling DATA Step Processing Review Questions
Q1. Which of the following is not created during the compilation phase?
[expand title=View Answer] the first observation[/expand]
Q2. During the compilation phase, SAS scans each statement in the DATA step, looking for syntax errors. Which of the following is not considered a syntax error?
[expand title=View Answer] incorrect data values [/expand]
Q3. nUnless otherwise directed, how many times does the DATA step loop execute?
[expand title=View Answer] once for each row in the input file [/expand]
Q4. At the beginning of the execution phase, the value of N is 1, the value of ERROR is 0, and the values of the remaining variables are set to which of the following?
[expand title=View Answer] missing [/expand]
Q5. Suppose you run a program that causes three data errors. What is the value of the automatic variable ERROR when the row that contains the third error is processed?
[expand title=View Answer] 2 [/expand]
Q6. Which of the following actions occurs at the beginning of an iteration of the DATA step?
[expand title=View Answer] The values of variables created in programming statements are reset to missing in the program data vector. [/expand]
Q7. Consider the following DATA step. Based on the sample input file below, in what order are the variables stored in the new fin2 table?
data fin2;
set finance;
keep Name Raise NewSalary Date;
if Salary>25000 then Raise=0.03;
else Raise=0.05;
NewSalary=(Salary*Raise)+Salary;
run;
[expand title=View Answer] Name, Raise, NewSalary, Date [/expand]
Q8. If the input table contains five columns, which PUTLOG statements create the following results in the SAS log?
[expand title=View Answer]
putlog “NOTE: Begin DATA Step”;
putlog all;
[/expand]
Q9. After this program runs, how many rows are in the forecast table, assuming that there are 10 rows in the sales table?
data forecast;
set sales;
Qtr=1;
Sales=Sales1.01; output; Qtr=2; Sales=Sales1.01;
output;
Qtr=3;
Sales=Sales*1.01;
[expand title=View Answer] 30 [/expand]
Q10. Suppose there are 1,000 total customers, and 200 of those customers have Gold status. After this code runs, how many rows are in the gold table and how many rows are in the other table?
data gold other;
set customers;
if Status="Gold" then output gold;
run;
[expand title=View Answer] 200 in gold and 800 in other [/expand]
Q11. After this code runs, how many columns are in the Canada table if there are 10 columns in the input customer table?
data Canada(drop=State Zip) US(drop=Province);
set customer(keep=ID Name Country Status
Sales State Zip Province);
if Country=”Canada” then output Canada;
else if Country=”US” then output us;
drop Country;
run;
[expand title=View Answer] 5 [/expand]
Get All Course Quiz Answers of Business English Specialization
Business English: Management and Leadership Quiz Answers
Business English: Finance and Economics Quiz Answers
Business English: Marketing and Sales Quiz Answers