Documentos de Académico
Documentos de Profesional
Documentos de Cultura
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?
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.);
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.);
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
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.
data _null_ ;
phone = '(312) 555-1212' ;
substr(phone, 2, 3) = '773' ;
put phone = ;
run ;
DATA NEW ;
A = 123456 ;
X = INT( A/1000 ) ;
Y = MOD( A, 1000 ) ;
Z = MOD( INT( A/100 ), 100 ) ;
PUT A= X= Y= Z= ;
RUN
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
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;
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.