|
Bob Burnham <robert.a.burnham@dartmouth.edu> writes:
> +----------------------------------------------------------------
> | So for example, 746AD1 would become 746AD; 752B2 would become
> | 752B; 752 would be left unchanged. Ive appended a listing of
> | typical context values.
> +----------------------------------------------------------------
Oops! I missed the 752 would be unchanged too! Here is the
corrected code:
data test (drop=c);
input context $;
c = substr(context, length(context), 1);
if (indexc(context, "ABCDEFGHIJKLMOPQRSTUVWXYZ")) then do;
if (indexc(c, "0123456789")) then
newcontext = substr(context, 1, length(context) - 1);
else newcontext = context;
end;
else newcontext = context;
datalines;
792B
736D
736E
792C1
746AD1
753C
etc.
Worst of all, I can't blame this on a lack of coffee. . . :>)
Bob
--
Bob Burnham
robert.a.burnham@dartmouth.edu
http://www.dartmouth.edu/~bburnham
|