Don't forget to create account on our site to get access to more material made only for free registered user.  
SAS A00-211 Certification SAS A00-212 Certification Questions and Answers SAS A00 240 Certification Material SAS A00-250 Exam Material Certification SAS Packaged Solutions

Question : 11 Due to growth within the 919 area code, the telephone exchange 555 is being reassigned to the 920 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?
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;

Correct Answer : 3
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 39), the function extracts a substring

You have no rights to post comments