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 : 12 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?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;

Correct Answer : 2

Exp : The TRIM function removes trailing blanks from character values. In this case, extra blanks must be removed from the values of FirstName. Although answer c also works, the extra TRIM function for the variable LastName is unnecessary. Because of the LENGTH statement, all values of FullName are padded to 40 characters.

You have no rights to post comments