Explore advanced SAS techniques in 'SAS Chapter 15: Combining Data Horizontally', focusing on skills like match-merge, PROC SQL joins, and handling multiple datasets. This quiz assesses understanding of critical data manipulation methods essential for efficient data analysis.
proc sum data=sasuser.emdata noprint; output out=sasuser.summary sum=Salarysum; run;
proc means data=sasuser.empdata noprint; var salary; output out=sasuser.summary sum=Salarysum; run;
proc sum data=sasuser.empdata noprint; var salary; output out=sasuser.summary sum=Salarysum; run;
proc means data=sasuser.empdata noprint; output=sasuser.summary sum=Salarysum; run;
Rate this question:
Code and IDnum
Manager and Supervisor
Manager and IDnum
There are no variables that are common to both of these data sets.
Rate this question:
It is automatically created when you use either a SET statement with the KEY= option or the MODIFY statement with the KEY= option in a DATA step.
A value of zero for _IORC_ means that the most recent SET statement with the KEY= option (or MODIFY statement with the KEY= option) did not execute successfully.
A value of zero for _IORC_ means that the most recent SET statement with the KEY= option (or MODIFY statement with the KEY= option) executed successfully.
You can use the _IORC_ variable to prevent nonmatching data from being included when you use an index to combine data from multiple data sets.
Rate this question:
proc sql; select newsals.empcode allemps.lastname newsals.salary contrib.amount from sasuser.allemps, sasuser.contrib, sasuser.newsals where empcode=allemps.empid and empcode=contrib.empid; quit;
proc sql; create table usesql as select newsals.empcode allemps.lastname newsals.salsry contrib.amount from sasuser.allemps, sasuser.contrib, sasuser.newsals quit;
proc sql; create table usesql as; select newsals.empcode, allemps.lastname, newsals.salary, contrib.amount; from sasuser.allemps, sasuser.contrib, sasuser.newsals; where empcode=allemps.empid and empcode=contrib.empid; quit;
proc sql; create table usesql as select newsals.empcode, allemps.lastname, newsals.salary, contrib.amount from sasuser.allemps, sasuser.contrib, sasuser.newsals where empcode=allemps.empid and empcode=contrib.empid; quit;
Rate this question:
Next, SAS sequentially match-merges observations and writes the new observation to the PDV, then to the new data set. When the BY value changes in all the input data sets, the PDV is initialized to missing. Missing values for variables, as well as missing values that result from unmatched observations, are written to the new data set.
Next, SAS sequentially match-merges observations and writes the new observation to the PDV, then to the new data set. After each DATA step iteration, the PDV is initialized to missing. Missing values for variables, as well as missing values that result from unmatched observations, are omitted from the new data set.
Next, SAS creates a Cartesian product of all possible combinations of observations and writes them to the PDV, then to the new data set. Then SAS goes through the new data set and eliminates all observations that do not have matching values of the BY variable.
Next, SAS creates a Cartesian product of all possible combinations of observations and writes them to the PDV, then to the new data set. The new data set is then ordered by values of the BY variable.
Rate this question:
You can use multiple SET statements to combine observations from several SAS data sets.
Processing stops when SAS encounters the end-of-file (EOF) marker on either data set (even if there is more data in the other data set).
You can use multiple SET statements in one DATA step only if the data sets in each SET statement have a common variable.
The variables in the PDV are not reinitialized when a second SET statement is executed.
Rate this question:
The value is missing.
$350.00
$520.00
$1100.00
Rate this question:
$1000
$3000
The value is missing.
The value cannot be determined without seeing the data that is in Sasuser.Summary.
Rate this question:
data work.profit; set sasuser.sale2000(keep=routeid flightid date rev1st revbusiness revecon revcargo) key=flightdate; set sasuser.dnunder; Profit=sum(rev1st, revbusiness, revecon, revcargo, -expenses); run;
data work.profit; set sasuser.dnunder; set sasuser.sale2000(keep=routeid flightid date rev1st revbusiness revecon revcargo) key=flightdate; where routeid='0000103'; Profit=sum(rev1st, revbusiness, revecon, revcargo, -expenses); run;
data work.profit; set sasuser.dnunder; set sasuser.sale2000(keep=routeid flightid date rev1st revbusiness revecon revcargo); key=flightdate; Profit=sum(rev1st, revbusiness, revecon, revcargo, -expenses); run;
data work.profit; set sasuser.dnunder; set sasuser.sale2000(keep=routeid flightid date rev1st revbusiness revecon revcargo) key=flightdate; Profit=sum(rev1st, revbusiness, revecon, revcargo, -expenses); run;
Rate this question:
Quiz Review Timeline (Updated): May 27, 2024 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.