Premium

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



Question : You have bene given below dataset


Which of the following code read LOCATION and Course_duraction correctly?

A. Input
#2 location $ duration ;

B. Input
@2 location $ duration ;

C. Input
#1 course_name $ course_date mmddyy8.
#2 location $ duration ;

D. Input
#2 location $ duration ;
#1 course_name $ course_date mmddyy8.

  : You have bene given below dataset
1. A,B,C
2. A,C,D
3. Access Mostly Uused Products by 50000+ Subscribers
4. B,C,D
Correct Answer : Exp : Question is asking to read data for both location and course_duration which always appears in nd line. So we can use line
position control for that. In option @2 is used which is not correct line control syntax we can rule it out. Now remaining all three are correct.


Question : You have been given below dataset


Which of the following program can read data correctly?

  : You have bene given below dataset
1. input
course_id $ /
course_name $ training_date mmddyy8. /
location $ duration /
Fee INSTITUTE $;


2. input
# 1 course_id $
#4 course_name $ training_date mmddyy8. /
location $ duration /
Fee INSTITUTE $;


3. Access Mostly Uused Products by 50000+ Subscribers
# 4 course_id $ /
#1 course_name $ training_date mmddyy8. /
location $ duration /
Fee INSTITUTE $;


4. input
# 4 course_id $
#1 course_name $ training_date mmddyy8. /
location $ duration /
Fee INSTITUTE $;


Correct Answer : Get Lastest Questions and Answer :
Explanation: We need to check which has correct syntax and correct use of #n and / sign. In option 1 we have used just / , it means data is
proper order. But when you look that is not the case, course_id is at line 4 and we are trying to read it from line 1, so option 1 is out. Next option 2
we have used #n absolute line position, again course_id at line 4 and we are using it as a #1 this is not correct, however you can read course_name
value to course_id variable technically syntax wise nothing wrong, but as soon as you start reading line 4 for two variables course_name training_date
than it will fail saying only 1 variable on line 4. Hence, option 2 is wrong. Option C is wrong because we have used forward line control in first line
and then again used the absolute line position to line 1 , this is not the correct syntax, hence it is out. Now you can validate option 4 which is
correct syntax as well reading the values as per need.



Question : Which of the following read correctly course_name, corse_date, location, duration , course_fee and institute in this order


 : Which of the following read correctly course_name, corse_date, location, duration , course_fee and institute in this order
1. input course_name $ training_date mmddyy8. /
location $ duration /
Fee INSTITUTE $;


2. input
#1 course_name $ training_date mmddyy8. /
#2 location $ duration /
#3 Fee INSTITUTE $;


3. Access Mostly Uused Products by 50000+ Subscribers
location $ duration /;
Fee INSTITUTE $;


4. input
@1course_name $ training_date mmddyy8. /
@2 location $ duration /
@3 Fee INSTITUTE $;



Correct Answer : Get Lastest Questions and Answer :
Explanation: As you can see we to read data in sequence. We can use either #n or / forward line control. Option 4 is out. Option 3 uses
semicolon after each forward slash which is not correct hence option 3 is out. In option 2 we have wrongly used both #n and / and hence out. Only option
1 is correct which correctly uses the forward slash to move next line.




Question : You need to write a do loop which counts upto but in each iteration step should be incremented by value .

 : You need to write a do loop which counts upto  but in each iteration step should be incremented by value .
1. Do hecounter=1 to 100 by 10;

2. Do hecounter=1 to 100 by 10++;

3. Access Mostly Uused Products by 50000+ Subscribers

4. Do hecounter+10=1 to 100 ;


Correct Answer : Get Lastest Questions and Answer :
Explanation: Correct syntax to increment a counter by 10 is given using by statement and it must be defined where to start using hecounter=1
and end can be defined using to. Hence, option 1 is only correct.


Related Questions


Question :
Consider the data step:
Which of the following assignment statements for
variable group are functionally equivalent to the original
statement used in the above data step?
  :
1. if Age not in(15,16) then Group=1; else Group=2;
2. if (Age NE 16) or (Age NE 15) then Group=1; else Group=2;
3. Access Mostly Uused Products by 50000+ Subscribers
4. both A or C will work



Question :
The following SAS program is submitted:
data WORK.ACCOUNTING;
set WORK.DEPARTMENT;
length EmpId $6;
CharEmpid=EmpId;
run;
If data set WORK.DEPARTMENT has a numeric variable EmpId. Which statement is true about the
output dataset?

  :
1. The type of the variable CharEmpid is numeric.
2. The type of the variable CharEmpid is unknown.
3. Access Mostly Uused Products by 50000+ Subscribers
4. The program fails to execute due to errors.



Question :
The following SAS program is submitted:
data WORK.OUTDS;
do until(Prod GT 6);
Prod + 1;
end;
run;
What is the value of the variable Prod in the output data set?

  :
1. . (missing)
2. 6
3. Access Mostly Uused Products by 50000+ Subscribers
4. Undetermined, infinite loop.


Question :
The SAS program is submitted:

The SAS data set WORK.SALARY is currently ordered by Gender within Department.
Which inserted
code will accumulate subtotals for each Gender within Department?
  :
1. Gender
2. Department
3. Access Mostly Uused Products by 50000+ Subscribers
4. Department Gender



Question :
Which step displays a listing of all the data sets in the WORK library?
  :
1. proc contents lib=WORK
run;
2. proc contents lib=WORK.all;
run;
3. Access Mostly Uused Products by 50000+ Subscribers
run;
4. proc contents data=WORK _ALL_;
run;



Question :
Given the SAS data set WORK.ORDERS:

The variable order_id is numeric;
customer is character; and shipped is numeric,
contains a SAS date
value, and is shown with the DATE9. format.
A programmer would like to create a new variable,
ship_note, that shows a character value with
the order_id, shipped date, and customer name. For
example, given the first observation ship_note
would have the value "Order 9341 shipped on 02FEB2009
to Josh Martin".
Which of the following statement will
correctly create the value and assign it to ship_note?

  :
1. ship_note=catx(' ','Order',order_id,'shipped on',input(shipped,date9.),'to',customer);
2. ship_note=catx(' ','Order',order_id,'shipped on',char(shipped,date9.),'to',customer);
3. Access Mostly Uused Products by 50000+ Subscribers
4. ship_note=catx(' ','Order',order_id,'shipped on',put(shipped,date9.),'to',customer);