When one only needs taking a character out of a string, the char function is more efficient than substr by 25%.
885 data _null_ ;
886 length x $1;
887 s = '123456789ABCDEF' ;
888 do j = 1 to 1e7 ;
889 x=substr(s,10);
890 end ;
891 put x=;
892 run ;
x=A
NOTE: DATA statement used (Total process time):
real time 0.22 seconds
cpu time 0.21 seconds
893
894 data _null_ ;
895 length x $1;
896 s = '123456789ABCDEF' ;
897 do j = 1 to 1e7 ;
898 x=char(s,10);
899 end ;
900 put x=;
901 run ;
x=A
NOTE: DATA statement used (Total process time):
real time 0.16 seconds
cpu time 0.15 seconds