Premium

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



Question : Which of the variable declaration increase the value of the variable named fee with the %?

 : Which of the variable declaration increase the value of the variable named fee with the %?
1. Fee= fee*100;

2. Fee= fee+(fee*2);

3. Access Mostly Uused Products by 50000+ Subscribers

4. Fee=*2;


Correct Answer : Get Lastest Questions and Answer :
Explanation: In option 1 you are increasing fee by 100 times. In option 2 you are increasing fee by 200% . Assume current fee is 5000 then
after evaluating this expression fee will become 5000+(5000*2)=15000. In option 3 fee will be 10000 and option 4 is not correct. Hence, option 2 is
correct as per the given requirement.





Question : The following SAS program is submitted:

data test;
infile `file specification';
input name $ amount@@;
run;

Which of the following is true?
 :  The following SAS program is submitted:
1. Two @@ together are the same as one c
2. Two @@ hold the data records until the bottom of the DATA step.
3. Access Mostly Uused Products by 50000+ Subscribers
4. Two @@ are invalid syntax and will cause the program to fail to execute.

Correct Answer : Get Lastest Questions and Answer :

Explanation: Using the Double Trailing @ Line-Hold Specifier
Sometimes you may need to create multiple observations from a single record of raw data. One way to tell SAS how to read such a record is to use the other line-hold specifier, the
double trailing at-sign (@@ or "double trailing @"). The double trailing @ not only prevents SAS from reading a new record into the input buffer when a new INPUT statement is
encountered, but it also prevents the record from being released when the program returns to the top of the DATA step. (Remember that the trailing @ does not hold a record in the
input buffer across iterations of the DATA step.)
For example, this DATA step uses the double trailing @ in the INPUT statement:
data body_fat;
input Gender $ PercentFat @@;
datalines;
m 13.3 f 22
m 22 f 23.2
m 16 m 12
;
proc print data=body_fat;
title 'Results of Body Fat Testing'; run;
The following output shows the resulting data set: Data Set Created with Double Trailing @
Results of Body Fat Testing 1
Percent
Obs Gender Fat

1 m 13.3
2 f 22.0
3 m 22.0
4 f 23.2
5 m 16.0
6 m 12.0





Question :

Which SAS statement correctly uses column input to read
the values in the raw data file below in this order: Address
(4th field), SquareFeet (second field), Style (first field),
Bedrooms (third field)?


 :
1. input Address 15-29 SquareFeet 8-11 Style 1-6
Bedrooms 13;
2. input $ 15-29 Address 8-11 SquareFeet $ 1-6 Style
13 Bedrooms;
3. Access Mostly Uused Products by 50000+ Subscribers
Bedrooms 13;
4. input Address 15-29 $ SquareFeet 8-11 Style 1-6
$ Bedrooms 13;

Correct Answer : Get Lastest Questions and Answer :

Explanation: Column input specifies the variable's name, followed by a dollar ($) sign if the values are character values, and the beginning and ending column locations of the raw data
values.






Related Questions


Question :
Which one of the following is true of the RETAIN statement in a SAS DATA step program?
  :
1. It can be used to assign an initial value to _N_ .
2. It is only valid in conjunction with a SUM function.
3. Access Mostly Uused Products by 50000+ Subscribers
4. It adds the value of an expression to an accumulator variable and ignores missing values.


Question :
A raw data file is listed below:
--------10-------20-------30
1901 2
1905 1
1910 6
1925 .
1941 1
The following SAS program is submitted and references the raw data file above:
data coins;
infile 'file-specification';
input year quantity;

run;
Which one of the following completes the program and produces a non-missing value for the variable TOTQUANTITY in the last
observation of the output data set?

  :
1. totquantity + quantity;
2. totquantity = sum(totquantity + quantity);
3. Access Mostly Uused Products by 50000+ Subscribers
sum totquantity;
4. retain totquantity 0;
totquantity = totquantity + quantity;



Question :
A raw data file is listed below:
--------10-------20-------30
squash 1.10
apples 2.25
juice 1.69
The following SAS program is submitted using the raw data file above:
data groceries;
infile 'file-specification';
input item $ cost;

run;
Which one of the following completes the program and produces a grand total for all COST values?


  :
1. grandtot = sum cost;
2. grandtot = sum(grandtot,cost);
3. Access Mostly Uused Products by 50000+ Subscribers
grandtot = sum(grandtot,cost);
4. grandtot = sum(grandtot,cost);
output grandtot;



Question :
The following SAS program is submitted:
data work.total;
set work.salary(keep = department wagerate);
by department;
if first.department then payroll = 0;
payroll + wagerate;
if last.department;
run;
The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments.
Which one of the following represents how many observations the WORK.TOTAL data set contains?

  :
1. 5
2. 20
3. Access Mostly Uused Products by 50000+ Subscribers
4. 500



Question :
The following SAS program is submitted:
data work.total;
set work.salary(keep = department wagerate);
by department;
if first.department then payroll = 0;
payroll + wagerate;
if last.department;
run;
The SAS data set named WORK.SALARY contains 10 observations for each department, currently ordered by DEPARTMENT.
Which one of the following is true regarding the program above?

  :
1. The BY statement in the DATA step causes a syntax error.
2. FIRST.DEPARTMENT and LAST.DEPARTMENT are variables in the WORK.TOTAL data set.
3. Access Mostly Uused Products by 50000+ Subscribers
4. The values of the variable PAYROLL represent a total for all values of WAGERATE in the WORK.SALARY data set.



Question :
The following SAS program is submitted:
libname sasdata 'SAS-data-library';
data test;
set sasdata.chemists (keep = job_code);
if job_code = 'chem3'
then description = 'Senior Chemist';
run;
The variable JOB_CODE is a character variable with a length of 6 bytes.
Which one of the following is the length of the variable DESCRIPTION in the output data set?


  :
1. 6 bytes
2. 8 bytes
3. Access Mostly Uused Products by 50000+ Subscribers
4. 200 bytes