Quiz

  1. If a substring is not found in a string, the FIND function returns which value?
    1. 0
    2. 1
    3. 2
    4. Not found.
  2. Given the following DATA step, what is the value of USNum and WordNum?
    data work.Count;
       Text='AUSTRALIA, ENGLAND, CANADA, AUSTRIA, ITALY, US, SPAIN';
       USNum=count(Text,'CANADA');
       WordNum=countw(Text);
    run;
    1. 0, 7
    2. 1, 7
    3. 3, 0
    4. 3, 0
  3. Which program would correctly generate two separate lagged variables for each observation?
    1. data work.samp1;
         set work.lag0;
         y=lag1-lag2(item);
      run;
      proc print data=work.samp1;
      run;
    2. data work.samp2;
         set work.lag0;
         y=lag2(item);
      run;
      proc print data=work.samp2;
      run;
    3. data work.samp3;
         set work.lag0;
         x=lag1(item);
         y=lag2(item);
      run;
      proc print data=work.samp3;
      run;
    4. data work.samp4;
         set work.lag0;
         y=lag1(item);
         y=lag2(item);
      run;
      proc print data=work.samp4;
      run;
  4. What is the value of the column Position?
    Position=prxmatch('/Dutch/','Sawyer Dutch Kenai');
    1. 2
    2. 7
    3. 8
    4. 12
  5. Which program correctly searches a string for a substring and returns the position of a substring?
    1. data _null_;
         position=prxmatch('/mind/', 'Learning never exhausts the mind.');
         put position=;
      run;
    2. data _null_;
         position=prxchange('/mind/', 'Learning never exhausts the mind.');
         put position=;
      run;
    3. data _null_;
         position=prxparse('/mind/', 'Learning never exhausts the mind.');
         put position=;
      run;
    4. data _null_;
         position=findw('/mind/', 'Learning never exhausts the mind.');
         put position=;
      run;
  6. Which program correctly changes the order of first and last names?
    1. data work.reverse;
         set certadv.reversedNames;
         name=prxmatch('/name/', name);
      run;
    2. data work.reverse;
         set certadv.reversedNames;
         name=prxchange('s/(w+),(w+)/$2 $1/', -1, name);
      run;
    3. data work.reverse;
         if _N_=1 then do;
            pattern='/name';
            name=prxparse(pattern);
         end;
         set certadv.reversedNames;
      run;
    4. None of the above.
  7. Perl regular expressions in the PRXMATCH function must start and end with a delimiter.
    1. True
    2. False
  8. Which Perl regular expression replaces the string ABC with the string ABC87?
    1. 'r/ABC/ABC87/'
    2. 'r/ABC87/ABC/'
    3. 's/ABC87/ABC/'
    4. 's/ABC/ABC87/' 
      
Last updated: October 16, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.238.159