By admin | November 4, 2009

SAS Certified Adv Programmer 130 Questions (12)

Given the following SAS statement:

%let idcode = Prod567;

Which one of the following statements stores the value 567 in the macro variable CODENUM?

A. %let codenum = substr(&idcode,length(&idcode)-2);
B. %let codenum = substr(&idcode,length(&idcode)-3);
C. %let codenum = %substr(&idcode,%length(&idcode)-2);
D. %let codenum = %substr(&idcode,%length(&idcode)-3);

2 comments | Add One

  1. admin - 11/4/2009 at 9:30 am

    C

  2. Consty - 02/19/2013 at 1:48 pm

    C: retrieve the substring from the 5 th position

Leave a Comment

Leave a Reply

Your email address will not be published.