You are on page 1of 4

1.

The following SAS program is submitted:


%macro one(input);
%two;
%put the value is &date;
%mend;
%macro two;
data _null_;
call symput('date','12SEP2008');
run;
%mend;
%let date=31DEC2006;
%one(&date)
What is the result when the %PUT statement executes?
-----------------------------------------------------------------------------------------------------------------------------
2. The following SAS program is submitted:
%macro check(num=4);
%let result=%sysevalf(&num+0.5);
%put result is &result;
%mend;
%check(num=10)
What is the written to the SAS log?
-----------------------------------------------------------------------------------------------------------------------------
3. The following SAS program is submitted:
%micro test(var);
%let jobs=BLACKSMITH WORDSMITH SWORDSMITH;
%let type=%index(&jobs,&var);
%put type = &type;
%mend;
%test(SMITH)
What is the value of the macro variable TYPE when the %PUT statement executes?
-----------------------------------------------------------------------------------------------------------------------------
4. The following SAS program is submitted:
data view=sauser.ranch;
describe;
run;
What is the result?
-----------------------------------------------------------------------------------------------------------------------------
5. Which SAS procedure changes the name of a permanent format for a variable stored in a SAS
data set?
6. -----------------------------------------------------------------------------------------------------------------------------
7. Given the SAS data set ONE:
ONE
DIVISION SALES
A 1234
A 3654
B 5678
The following SAS program is submitted:
Data _null_;
Set one;
By divition;
If first.division then
Do;
%let mfirst=sales;
end;
run;
What is the value of the macro variable MFRIST when the program finishes execution?
1/4
-----------------------------------------------------------------------------------------------------------------------------

8. The following SAS program is submitted:


%let a=cat;
%macro animal(a=frog);
%let a=bird;
%mend;
%animal(a=pig)
%put a is &a;
What is written to the SAS log?
-----------------------------------------------------------------------------------------------------------------------------
9. The following SAS program is submitted:
%let lib=%upcase(sauser);
proc sql;
select nvar form dictionary.tables
where libname='&lib';
quit;
Several SAS data sets exist in the SAUSER library.
What is generated as output?
-----------------------------------------------------------------------------------------------------------------------------
10. The following SAS program is submitted:
%let first=yourname;
%lest last=first
%put &&last;
-----------------------------------------------------------------------------------------------------------------------------
11. What is written to the SAS log?
The following SAS program is submitted:
proc contents data = testdata.one;
run;
Which SQL procedure program produces similar information about the column attributes of the
dataset TESTDATA.ONE?
-----------------------------------------------------------------------------------------------------------------------------
12. The following SAS program is submitted:
%macro location;
data _null_;
call symput ('dept','sales');
run;
%let country=Germany;
%put_global_;
%mend;
%let company = ABC;
%location;
Which macro variables are written to the SAS log?
-----------------------------------------------------------------------------------------------------------------------------
13. The SAS data set WORK.TEMPDATA contains the variable FMTNAME, START and LABEL
and it consists of 10 observations.
The following SAS program is submitted:
proc format cntlin=work.tempdata;
run;
What is the result of submitting the FORMAT procedure step?
-----------------------------------------------------------------------------------------------------------------------------
14. The following SAS program is submitted:
options mprint;
%macro test(parm);
proc &parm data = sashelp.prdsale;

2/4
run;
%mend;
%test(print)
What is the result of the MPRINT options?
-----------------------------------------------------------------------------------------------------------------------------

15. The SAS data set ONE contains the variables X,Y,Z and W.
The following SAS program is submitted:
Proc transpose data =one
Out=trans
Name=new;
By x;
var y;
run;
What are the names of all of the columns created by the TRANSPOSE procedure?
-----------------------------------------------------------------------------------------------------------------------------
16. Which SAS integrity constraint type ensures that a specific set or range of values are the only
values in a variable?
-----------------------------------------------------------------------------------------------------------------------------

17. Which DICTIONARY table provides information on all the tables containing a variable name?
-----------------------------------------------------------------------------------------------------------------------------
18. What is an advantage of using a hash object in a SAS DATA step?
-----------------------------------------------------------------------------------------------------------------------------
19. The following SAS code is submitted:
%macro houses(dsn = houses,sub = RANCH);
data &dsn;
set sasuser.houses;
if style = "";
run;
%mend;
%houses(sub = SPLIT)
%houses(dsn = ranch)
%houses(sub = TWOSTORY)
What will be the value of the automatic macro variable SYSLAST?
-----------------------------------------------------------------------------------------------------------------------------
20. What are advantages of creating and using a SAS DATA step view?
-----------------------------------------------------------------------------------------------------------------------------
21. Which is the SAS SORT procedure options eliminates identical consecutive observations?
-----------------------------------------------------------------------------------------------------------------------------
21.The following SAS FORMAT procedure is submitted:
proc format lib = sasuser;
value tempc low < 0 = 'BELOW FREEZING'
0 < 5 = 'COLD'
5 < 10 = 'MILD'
10 < 15 = 'WARM'
15 high = 'HOT';
run;
How is the value 10 displayed when the format TEMPC is applied?
-----------------------------------------------------------------------------------------------------------------------------
22. The DICTIONARY.MACROS table stores information about what ?
-----------------------------------------------------------------------------------------------------------------------------
23. The following SAS program is submitted:
data two;
y = '2';
3/4
run;
%let x = 10;
%let var = y;
data one;
set two (keep = &var);
z = &var * &x;
run;
-----------------------------------------------------------------------------------------------------------------------------
24. What will be the value of the variable Z when the program finishes execution?
The following SAS program is submitted:
%let name = Patel's Restaurant;
Which statements avoids problems associated with the unbalanced quotation mark while
resolving value of this macro variable?
-----------------------------------------------------------------------------------------------------------------------------
25. How you can delete a macro variables?
-----------------------------------------------------------------------------------------------------------------------------
26. In how many ways you can create macro variables?
-----------------------------------------------------------------------------------------------------------------------------
27. How you can compile macro and store them? How you can called compied macros?
-----------------------------------------------------------------------------------------------------------------------------
28. How you will call macro for every observarion of dataset passing names value to macro
variable?
data names;
input names $;
datalines;
Ram
Sham
Radha
;
run;
%macro my_name(name);
%put my name is &name;
%mend;
-----------------------------------------------------------------------------------------------------------------------------
29. Can we write %if statement between Proc SQL? How?
-----------------------------------------------------------------------------------------------------------------------------
30. Difference between where and if statement?
-----------------------------------------------------------------------------------------------------------------------------
31. How you will debug sas macro?

4/4

You might also like