Professional Documents
Culture Documents
SAS Macro Questions Tzsolution
SAS Macro Questions Tzsolution
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