How to use dataset in sas programing
Given the SAS
data set ONE:
ONEREP COST
SMITH 200
SMITH 400
JONES 100
SMITH 600
JONES 100
The following SAS program is submitted:
proc sql;
select rep, avg(cost) as AVERAGE
from one
group by rep;
quit;
The following output is desired:
REP AVERAGE
SMITH 400
Which SQL procedure clause completes the program and generates the desired output?
A. having avg(cost) < (select avg(cost) from one)
B. where avg(cost) > (select avg(cost) from one)
C. having avg(cost) > (select avg(cost) from one)
D. where calculated average > (select avg(cost) from one)
Answer: C
5. Given the SAS data set ONE:
ONEDIVISIONSALES
A 1234
A 3654
B 5678
The following SAS program is submitted:
data _null_;
set one;
by division;
if first.division then
do;
%let mfirst = sales;
end;
run;
What is the value of the macro variable MFIRST when the program finishes execution?
A. 1234
B. 5678
C. null
D. sales
Answer: D
6. The following SAS program is submitted:
%let lib = %upcase(sasuser);
proc sql;
select nvar
from dictionary.tables
where libname = "&lib";
quit;
Several SAS data sets exist in the SASUSER library.
What is generated as output?
A. a report showing the numeric columns in each table in SASUSER
B. a report showing the number of columns in each table in SASUSER
C. a report showing the names of the columns in each table in SASUSER
D. a report showing the number of numeric columns in each table in SASUSER
Answer: B
ONEREP COST
SMITH 200
SMITH 400
JONES 100
SMITH 600
JONES 100
The following SAS program is submitted:
proc sql;
select rep, avg(cost) as AVERAGE
from one
group by rep;
quit;
The following output is desired:
REP AVERAGE
SMITH 400
Which SQL procedure clause completes the program and generates the desired output?
A. having avg(cost) < (select avg(cost) from one)
B. where avg(cost) > (select avg(cost) from one)
C. having avg(cost) > (select avg(cost) from one)
D. where calculated average > (select avg(cost) from one)
Answer: C
5. Given the SAS data set ONE:
ONEDIVISIONSALES
A 1234
A 3654
B 5678
The following SAS program is submitted:
data _null_;
set one;
by division;
if first.division then
do;
%let mfirst = sales;
end;
run;
What is the value of the macro variable MFIRST when the program finishes execution?
A. 1234
B. 5678
C. null
D. sales
Answer: D
6. The following SAS program is submitted:
%let lib = %upcase(sasuser);
proc sql;
select nvar
from dictionary.tables
where libname = "&lib";
quit;
Several SAS data sets exist in the SASUSER library.
What is generated as output?
A. a report showing the numeric columns in each table in SASUSER
B. a report showing the number of columns in each table in SASUSER
C. a report showing the names of the columns in each table in SASUSER
D. a report showing the number of numeric columns in each table in SASUSER
Answer: B
we will provdie more informations visit my site:
No comments:
Post a Comment