Premium

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



Question : You have been given below two datasets


And you apply below program
data course100;
merge course101 course102 ;
by COURSE_ID;
run;

Which of the following statement is correct?

 : You have been given below two datasets
1. For all the same course_id LOCATION value of the first data set course101 will remain as it is and Location from Course102 will be
discarded.

2. For the same course_id , merged data set course100 will have missing LOCATION.

3. Access Mostly Uused Products by 50000+ Subscribers

4. Value of all the common columns for which course_id matches will be unpredictable.


Correct Answer : Get Lastest Questions and Answer :
Explanation: In case of merge if id matches than all the columns which are common will be overwritten by the second dataset.




Question : You have been given below dataset and program


data course100;
merge course101 (in=in_first rename=(DATE=TRAINING_DATE))
course102 (in=in_second rename=(DATE=REGISTRATION_DATE)) ;
by COURSE_ID;
if in_first=1 and in_second=1;
run;

Which of the following is a correct output?


 : You have been given below dataset and program
1.
Image1
2.
Image2
3. Access Mostly Uused Products by 50000+ Subscribers
Image3
4. None of the above


Correct Answer : Get Lastest Questions and Answer :
Explanation: When you use the IN= option with the merge operation, it will help you to find whether match exists in both the dataset or not.
You can use if condition to have only matched dataset in the output. So in this case option 2 is correct which only print matching dataset present in
both the dataset. Also column will be re-named.




Question : You have two datasets Course and Course both have the Fee column variables. However, you dont want that Fee column from first
dataset will be overwritten during match merge. How can you avoid that, select the correct SAS program?

 : You have two datasets Course and Course both have the Fee column variables. However, you dont want that Fee column from first
1. data course100;
merge course101 (in=FirstFee)
course102 ;
by COURSE_ID;
if in_first=1 and in_second=1;
run;


2. data course100;
merge course101 (rename=(FEE=TRAINING_FEE))
course102 (rename=(FEE=REGISTRATION_FEE)) ;
by COURSE_ID;
run;


3. Access Mostly Uused Products by 50000+ Subscribers
merge course101 (out=(FEE=TRAINING_FEE))
course102 (out=(FEE=REGISTRATION_FEE)) ;
by COURSE_ID;
run;


4. Both 2 and 3 are correct


Correct Answer : Get Lastest Questions and Answer :
Explanation: When you use match merging and column with the same name is found in second data set . Than second dataset will overwrite the
first dataset column in output. To solve this issue, you can use rename= option which will re-name the column name. And you can do it with only one of
the dataset column name or both with separate name.


Related Questions


Question : Suppose the YEARCUTOFF= system option is set to . Which MDY function creates the date value for January , ?

 :  Suppose the YEARCUTOFF= system option is set to . Which MDY function creates the date value for January , ?
1. MDY(1,5,14)
2. MDY(5,1,14)
3. MDY(1,5,2014)
4. MDY(5,1,2014)



Question : The variable Address contains values such as Newdelhidl, DL. How do you assign the two-letter state abbreviations to a new variable named Capital?
 :  The variable Address contains values such as Newdelhidl, DL. How do you assign the two-letter state abbreviations to a new variable named Capital?
1. Capital=scan(address2,2);
2. Capital=scan(address2,13,2);
3. Capital=substr(address2,2);
4. Capital=substr(address2,13,2);


Question : The variable EmpCode contains values such as FL and MX.
The fourth character identifies sex. How do you assign these character codes to a new variable named MaleORFemale?
 :  The variable EmpCode contains values such as FL and MX.
1. MaleORFemale=scan(empcode,4);
2. MaleORFemale=scan(empcode,4,1);
3. MaleORFemale=substr(empcode,4);
4. MaleORFemale=substr(empcode,4,1);



Question : Due to growth within the area code, the telephone exchange is being reassigned to the area code.
The data set Clients.Piedmont includes the variable Phone, which contains telephone numbers in the form 919-555-1234.
Which of the following programs will correctly change the values of Phone?
 :  Due to growth within the  area code, the telephone exchange  is being reassigned to the  area code.
1. data work.piedmont(drop=areacode exchange);
set clients.piedmont;
Areacode=substr(phone,1,3);
Exchange=substr(phone,5,3);
if areacode='919' and exchange='555'
then scan(phone,1,3)='920';
run;
2. data work.piedmont(drop=areacode exchange);
set clients.piedmont;
Areacode=substr(phone,1,3);
Exchange=substr(phone,5,3);
if areacode='919' and exchange='555'
then phone=scan('920',1,3);
run;
3. data work.piedmont(drop=areacode exchange);
set clients.piedmont;
Areacode=substr(phone,1,3);
Exchange=substr(phone,5,3);
if areacode='919' and exchange='555'
then substr(phone,5,3)='920';
run;
4. data work.piedmont(drop=areacode exchange);
set clients.piedmont;
Areacode=substr(phone,1,3);
Exchange=substr(phone,5,3);
if areacode='919' and exchange='555'
then phone=substr('920',1,3);
run;


The SUBSTR function replaces variable values if it is placed on the left side of an assignment statement. When placed on the right side (Read explanation from Question ), the
function extracts a substring




Question : Suppose you need to create the variable FullName by concatenating the values of FirstName,
which contains first names, and LastName, which contains last names. What's the best way to remove extra blanks between first names and last names?

The SUBSTR function replaces variable values if it is placed on the left side of an assignment statement. When placed on the right side (Read explanation from  ), the
1. data work.maillist;
set retail.maillist;
length FullName $ 40;
fullname=trim firstname||' '||lastname;
run;
2. data work.maillist;
set retail.maillist;
length FullName $ 40;
fullname=trim(firstname)||' '||lastname;
run;
3. data work.maillist;
set retail.maillist;
length FullName $ 40;
fullname=trim(firstname)||' '||trim(lastname);
run;
4. data work.maillist;
set retail.maillist;
length FullName $ 40;
fullname=trim(firstname||' '||lastname);
run;


Question :
The SAS data set SASUSER.HOUSES contains a variable PRICE which has been assigned a permanent label of "Asking Price".
Which SAS program temporarily replaces the label "Asking Price" with the label "Sale Price" in the output?
 :
1. proc print data = sasuser.houses; label price = "Sale Price"; run;
2. proc print data = sasuser.houses label; label price "Sale Price"; run;
3. proc print data = sasuser.houses label; label price = "Sale Price"; run;
4. proc print data = sasuser.houses; price = "Sale Price"; run;