Premium

Base SAS Certified Associate: Programming Fundamentals Using SAS Questions and Answers (Dumps and Practice Questions)



Question : The following SAS program is submitted:

data one;
date = '04juI2014'd;
format date weekdate.; run;
proc print data = one; run;

What output is generated?
 : The following SAS program is submitted:
1. Obs date
1 Monday, July 4, 2014
2. Obs date
1 July4, 2014
3. Access Mostly Uused Products by 50000+ Subscribers
1 04Jul2014
4. Obs date
1 Monday, 07/04/2014

Correct Answer : Get Lastest Questions and Answer :


Explanation: The WEEKDATEw. format writes SAS date values in the form day-of-week, month-name dd, yy (or yyyy), where
dd
is an integer that represents the day of the month.
yy or yyyy
is a two-digit or four-digit integer that represents the year.
If w is too small to write the complete day of the week and month, SAS abbreviates as needed.





Question : Given the SAS data set PERM.STUDENTS:

PERM.STUDENTS NAME AGE
----------------
Allen 14
Alina 13
Babita 13
Kavel 14

The following SAS program is submitted:

libname perm `SAS data library';
data students;
set perm.students;
file `file specification';
put name $ age;
(insert statement here)
run;

The following double-spaced file is desired as output
Allen 14
Alina 13
Babita 13
Kavel 14

Which statement completes the program and creates the desired file?
 : Given the SAS data set PERM.STUDENTS:
1. put
2. put/;
3. Access Mostly Uused Products by 50000+ Subscribers
4. put _null_;

Correct Answer : Get Lastest Questions and Answer :


Explanation: Put statement : Writes lines to the SAS log, to the SAS output window, or to an external location that is specified in the most recent FILE statement.
Without Arguments : The PUT statement without arguments is called a null PUT statement. The null PUT statement
writes the current output line to the current location, even if the current output line is blank
releases an output line that is being held with a trailing @ by a previous PUT statement.





Question : For the first observation, what is the value of diff{i}
at the end of the second iteration of the DO loop?

array wt{*} obs1-obs10;
array diff{9};
do i=1 to 9;
diff{i}=wt{i+1}-wt{i};
end;

 : For the first observation, what is the value of diff{i}
1. 15
2. 10
3. Access Mostly Uused Products by 50000+ Subscribers
4. -7


Correct Answer : Get Lastest Questions and Answer :

Explanation: At the end of the second iteration, diff{i} resolves as follows: diff{2}=wt{2+1}-wt{2}; diff{2}=215-200
In the DO statement, you specify the index variable that represents the values of the array elements. Then specify the start and stop positions of the array elements. Example : Using
the Iterative DO Statement without Infinite Looping In each of the following examples, the DO group executes ten times. The first example demonstrates the preferred approach.
do i=1 to 10;
...more SAS statements...
end;
The next example uses the TO and BY arguments.
do i=1 to n by m;
...more SAS statements...
if i=10 then leave;
end;
if i=10 then put 'EXITED LOOP';
Example : Stopping the Execution of the DO Loop In this example, setting the value of the index variable to the current value of EXIT causes the loop to terminate.
data iterate1;
input x;
exit=10;
do i=1 to exit;
y=x*normal(0);
/* if y>25, */
/* changing i's value */
/* stops execution */
if y>25 then i=exit;
output;
end;
datalines;
000
;


Related Questions


Question : You have been given a data sets in row and column format as below, please find number of observations and variables in it?

EmployeeName,salary,dateofBirth
Rahul,100K,08071978
Vineet,NA,08091970
Venkat,200K,09091973
Sonal,150K,09081988


 : You have been given a data sets in row and column format as below, please find number of observations and variables in it?
1. 3 observations, 4 variables
2. 3 observations, 3 variables
3. Access Mostly Uused Products by 50000+ Subscribers
. Question does not have entire information.



Question :

A raw data record is listed below:
--------10-------20-------30
1999/10/25
The following SAS program is submitted:
data projectduration;
infile 'file-specification';
input date $ 1 - 10;

run;
Which one of the following statements completes the program above and computes the duration of the project in days as of today's
date?


 :
1. duration = today( ) - put(date,ddmmyy10.);
2. duration = today( ) - put(date,yymmdd10.);
3. Access Mostly Uused Products by 50000+ Subscribers
4. duration = today( ) - input(date,yymmdd10.);



Question :

The following SAS program is submitted:
data work.month;
date = put('13mar2000'd,ddmmyy10.);
run;
Which one of the following represents the type and length of the variable DATE in the output data set?

 :
1. numeric, 8 bytes
2. numeric, 10 bytes
3. Access Mostly Uused Products by 50000+ Subscribers
4. character, 10 bytes


Question :

The following SAS program is submitted:
data work.month;
date = input('13mar2000',date9.);
run;
Which one of the following represents the type and length of the variable DATE in the output data set?


 :
1. numeric, 8 bytes
2. numeric, 9 bytes
3. Access Mostly Uused Products by 50000+ Subscribers
4. character, 9 bytes


Question :

The following SAS program is submitted:
data work.products;
Product_Number = 5461;
Item = '1001';
Item_Reference = Item'/'Product_Number;
run;
Which one of the following is the value of the variable ITEM_REFERENCE in the output data set?
 :
1. 1001/5461
2. 1001/ 5461
3. Access Mostly Uused Products by 50000+ Subscribers
4. The value cannot be determined as the program fails to execute due to errors.


Question : The following SAS program is submitted:
data work.retail;
cost = '20000';
total = .10 * cost;
run;
Which one of the following is the value of the variable TOTAL in the output data set?

 : The following SAS program is submitted:
1. 2000
2. '2000'
1. . (missing numeric value)
2. ' ' (missing character value)