Premium

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



Question :

The following SAS program is submitted and reads 100 records from a raw data file:
data work.total;
infile 'file-specification' end = eof;
input name $ salary;
totsal + salary;

run;
Which one of the following IF statements writes the last observation to the output data set?



  :
1. if end = 0;
2. if eof = 0
3. Access Mostly Uused Products by 50000+ Subscribers
4. if eof = 1;

Correct Answer : Get Lastest Questions and Answer :

Explanation: end is sas keyword which will become true when SAS reads last record of a dataset. This value you cannot use directly in your program, so we create a alias name eof (end of
file), but you can name it anything. EOF will carry the same value as internal variable END. So as we know 1=true and 0= false. if EOF = 1; will output only the last observation.
Answer is 4





Question :

The following SAS program is submitted:
libname rawdata1 'location of SAS data library';
filename rawdata2 'location of raw data file';
data work.testdata;
infile
input sales1 sales2;
run;
Which one of the following is needed to complete the program correctly?



  :
1. rawdata1
2. rawdata2
3. Access Mostly Uused Products by 50000+ Subscribers
4. 'rawdata2'

Correct Answer : Get Lastest Questions and Answer :

Explanation: no need quotation mark for infile or filename. but the location needs within the quotation mark.
Since if you have already intialized the path with a filename,you dont have to include quotation again.





Question :
The contents of the raw data file TYPECOLOR are listed below:
---------10--------20--------30
daisyyellow
The following SAS program is submitted:
data flowers;
infile 'typecolor';
input type $ 1-5 +1 color $;
run;
Which one of the following represents the values of the variables TYPE and COLOR?
  :
1. type color
daisy yellow
2. type color
daisy ellow
3. Access Mostly Uused Products by 50000+ Subscribers
daisyyellow (missing character value)
4. No values are stored as the program fails to execute due to syntax errors.

Correct Answer : Get Lastest Questions and Answer :

Explanation: by default sas proceeds to next column. here after reading 5 colums for type the position of the pointer is at y. due to +1 cursor moves to one column more

The column numbers at the top are wrong. They should be:
---------10--------20--------30
daisyyellow

We should be allowed the "pre" tag to display fixed-width code.

Are we to assume that typecolor in:
infile 'typecolor';
is substituted with the path to the file?

If so, B is the correct answer: After input type $ 1-5, the pointer is on the "y", +1 causes the pointer to skip over it.





Related Questions


Question : You have been given below SAS program

data course100 ;
Fee=5000;
FEE_HIKE=0.1;

do month=1 to 12 ;
INCREASE+(FEE+INCREASE)*FEE_HIKE;
iteration+1;
output;
end;
put _all_;
run;

At the end of do loop, where statement put _all_ is written what would be the value hold by variable moth?

 : You have been given below SAS program
1. 11

2. 12

3. Access Mostly Uused Products by 50000+ Subscribers

4. 0

5. Missing



Question :
The following PROC PRINT output was created immediately after PROC TABULATE output.
Which system options were specified when the report was created?
  :
1. OBS=, DATE, and NONUMBER
2. NUMBER, PAGENO=1, and DATE
3. Access Mostly Uused Products by 50000+ Subscribers
4. none of the above

Ans : 2
Exp : Clearly, the DATE and NUMBER (page number) options are specified. Because the page number on the output is 1, even though PROC TABULATE output was just produced, PAGENO=1
must also have been specified. If you don't specify PAGENO=, all output in the Output window is numbered sequentially throughout your SAS session.



Question :

Which of the following programs correctly references a SAS data set named SalesAnalysis that is stored in a permanent SAS library?

  :
1. data saleslibrary.salesanalysis;
set mydata.quarter1sales;
if sales>100000;
run;
2. data mysales.totals;
set sales_99.salesanalysis;
if totalsales>50000;
run;
3. Access Mostly Uused Products by 50000+ Subscribers
var sales salesrep month;
run;
4. proc freq data=1999data.salesanalysis;
tables quarter*sales;
run;

Ans : 2
Exp : Librefs must be 1 to 8 characters long, must begin with a letter or underscore, and can contain only letters, numerals, or underscores. After you assign a libref, you specify
it as the first level in the two-level name for a SAS file.


Question : You have been given below SAS program, select the statement which is correct

data course100 ;
Fee=5000;
FEE_HIKE=0.1;

do month=1 to 12 ;
INCREASE+(FEE+INCREASE)*FEE_HIKE;
iteration+1;
output;
end;
put _all_;
run;

A. There would be 12 iteration
B. Output statement will help in generating only last observation as an output.
C. Last value hold by month variable will be 13
D. Iteration variable is redundant, and does not help in creating output.

  :
1. A,B,C
2. B,C,D
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,B,D


Question : You have been given below SAS program

data course100 ;
Fee=5000;
FEE_HIKE=0.1;

do month=1 to 15 by 3 ;
INCREASE+(FEE+INCREASE)*FEE_HIKE;
iteration+1;
output;
end;
put _all_;
run;

proc print data=course100; run;

How many observation will be in course100 dataset

 : You have been given below SAS program
1. 15

2. 12

3. Access Mostly Uused Products by 50000+ Subscribers

4. 4

5. 6



Question : You need to find that how many year it will take to reach your INR investment every year with % compounding interest rate to have
100000 or more, which of the following you will consider?

 : You need to find that how many year it will take to reach your INR investment every year with % compounding interest rate to have
1. Do loop

2. DO Until loop

3. Access Mostly Uused Products by 50000+ Subscribers

4. Where condition



Question : Which of the following statements are correct, with regards to DO UNTIL statement

A. DO UNTIL statement will always execute enclosed statements at least once.
B. DO UNTIL statement may not execute enclosed statements if condition is true at the start.
C. All the enclosed statements will be executed if condition until become true.
D. END; statement is not mandatory its optional.


 : Which of the following statements are correct, with regards to DO UNTIL statement
1. A,B
2. B,C
3. Access Mostly Uused Products by 50000+ Subscribers
4. A,C
5. B,D


Question : You have been given a below SAS program

data course100 (drop=index);
do until(TOTAL_INCOME>100000);
TOTAL_INCOME+5000;
TOTAL_INCOME+TOTAL_INCOME*.10;
YEAR+1;
output;
put _all_;
end;
run;

Select the DO while statement which can be replace with the DO UNTIL statement?

 : You have been given a below SAS program
1. do while(TOTAL_INCOME>100000);

2. do while(TOTAL_INCOME<100000);

3. Access Mostly Uused Products by 50000+ Subscribers

4. do until(TOTAL_INCOME <> 100000);