Está en la página 1de 7

1) data work.

month;
date = put(13mar2000d,ddmmw10.);
run;
Which one of the following represents the type and length of the variable DATE in the
output data
set?
A. numeric, 8 bytes
B. numeric, 10bytes
C. character, 8 bytes
D. character, 10 bytes

2) data bonus;
infile file-specification;
input dept $ 1-11 number 13-15;
<insert code here>
run;
Which one of the following SAS statements completes the program and results in a value
ofPrinting 750 for the DEPARTMENT variable?
A. department = trim(dept) II number;
B. department = dept II input(number,3.);
C. department = trim(dept) II put(number,3.);
D. department = input(dept,11.) II input(number,3.);

3) Which one or the following SAS system options displays the time on a report?
A. TIME
B. DATE
C. TODAY
D. DATETIME

4) Which one of the following is true of the SUM statement in a SAS DATA step program?

A. It is only valid in conjunction with a SUM function.


B. It is not valid with the SET, MERGE and UPDATE statements.
C. It adds the value of an expression to an accumulator variable and ignores missing
values.
D. It does not retain the accumulator variable value from one iteration of the SAS DATA
step to
the next.
5) data revenue;
set year_1;
var1 = mdy(1,15,1960);
run;
Which one of the following values does the variable named VAR1 contain?
A. 14
B. 15
C. 1151960
D. 1/15/1960

6) A raw data record is listed below:


----I----10---I----20---I----30
1999/10/25
The following SAS program is submitted:
data projectduration;
infile file-specification;
input date$ 1- 10;
insert statement here>
run;

Which one of the following statements completes the program above and computes the
duration
of the project in days as of todays date?
duration = today( ) - put(date,ddmmyy10.);
duration = today( ) - put(date,yymmdd10.);
duration = today( ) - input(date,ddmmyy10.);
duration = today( ) - input(date,yymmdd10.);

7) The following SAS program is submitted:

data work.test;
Title = A Tale of Two Cities, Charles J. Dickens;
Word = scan(title,3, ,);
run;
Which one of the following is the value of the variable WORD in the output data set?
A. T
B. of
C. Dickens
D. (missing character value)
8). The following SAS program is submitted:

data work.test;
Author = Agatha Christie;
First = substr(scan(author,1, ,)1 ,1);
run;
Which one of the following is the length of the variable FIRST in the output data set?
A. 1
B. 6
C. 15
D. 200

9) The SAS data set ONE consists of five million observations and has 25 variables. Which one of
the following SAS programs successfully creates three new variables TOTREV, TOTCOST, and
PROFIT and requires the least CPU time to be processed?

A. data two;
set one;totrev = sum(price * quantity);
totcost = sum(fixed,variable);
profit = sum(totrev,otcost);
if totrev > 1000;
run;
B. data two;
set one;
totrev = sum(price * quantity);
if totrev > 1000;
totcost = sum(fixed,variable);
profit = sum(totrev,otcost);
run;
C. data two;
set one;
totrev = sum(price * quantity);
where totrev > 1000;
totcost = sum(fixed,variable);
profit = sum(totrev,otcost);
run;
D. data two;
set one;
where totrev > 1000;
totrev = sum(price * quantity);
totcost = sum(fixed,variable);
profit = sum(totrev,otcost);
run;
10) .Given the raw data record DEPT:
----|----10---|----20---|----30
Printing 750
The following SAS program is submitted:
data bonus;
infile `dept';
inputdept$ 1-11 number 13- 15;
<insert statement here>
run;

Which SAS statement completes the program and results in a value of `Printing750'
for the DEPARTMENT
variable?
A. department = dept II number;
B. department = left(dept) II number;
C. department = trim(dept) number;
D. department = trim(dept) put(number,3.);

11) The following SAS program is submitted:


data work.areacodes;
Phonenumber=3125551212;
Code='('!!substr(Phonenumber,1,3)!!')';
run;

Which one of the following is the value of the variable Code in the output data set?
a. ( 3)
b. (312)
c. 3
d. 312

12) A raw data record is listed below.


1---+----10---+----20---+---
$23,456 750
The following SAS program is submitted:
data bonus;
infile 'file-specification';
input salary $ 1-7 raise 9-11;
<insert statement here>
run;

Which one of the following statements completes the program and adds the values
of salary and raise to calculate the expected values of the newsalary variable?
a. newsalary=salary + raise;
b. newsalary=put(salary,comma7.) + raise;
c. newsalary=input(salary,comma7.) + raise;
d. newsalary=put(salary,comma7.) + put(raise,3.);

13). How many observations will be there dataset b if the following datastep is submitted?

Data b;
Set a;
Temp = qtr(input(Date,mmddyy10.));
If Temp LE 3;
RUN;

14) Difference between FUNCTION and PROC and give me an example for this.

15) What's the difference between VAR A1 - A3 and VAR A1 -- A3?

16) Whats the output of the Fallowing programme?

data _null_ ;
phone = '(312) 555-1212' ;
substr(phone, 2, 3) = '773' ;
put phone = ;
run ;

17) Write the output for fallowing programme.

DATA NEW ;
A = 123456 ;
X = INT( A/1000 ) ;
Y = MOD( A, 1000 ) ;
Z = MOD( INT( A/100 ), 100 ) ;
PUT A= X= Y= Z= ;
RUN

18).What is the significance of the OF in x=sum (of a1-a4, a6,a9);

19).Explain briefly about put and input functions and what happens if I want to get the
output with in same variable for put or input functions.
20) Given file like
Name
Anjali
Ramanatha
Raghunath

How can I change the only letters which are in odd position in given name variable write
the programme for it

21). The statement X = ROUND(26.3,10)-1; will give X the value of:

A 30
B 25.3
C 29
D 25
E missing

22) What is the difference between Mean function and Means procedure?

23) How can i find out difference between value1 values with value1 values
like 40-20, 60-40, 80-60 etc?
Example:-
Data ds;
Infile datalines;
Input id value1;
Datalines;
001 20 002 40
003 60 004 80
005 100
;
Run;

24) Write a programme to get the LOCF value in the fallowing given data?

DATA TEST;
INPUT PAT VISIT LABSTD;
CARDS;
101 1 0.1 101 2 0.3
101 3 .
101 5 0.1 101 6 0.9
102 1 0.7 102 2 0.3
102 3 .
102 5 0.4 102 6 0.9
;
Run;

25).Explain the difference between LAG and DIF functions

26).What is Variance function and give me an example with Explanation?

27).Can we copy variable values with in the same record by using SAS functions if yes,
How we can perform it?

28).Can we calculate frequency by using fuctions if yes, What is that Function and give me
an Example for it.

29).Difference between Index and Find Functions?

30).Give me few function name by which we can perform DATA CLEANING?

También podría gustarte