I guess you assume weeks per month = 4.34523809523809 (= 365/*(7*12)).
If you have only two original time units ("week/weeks" or "month/months") then discriminating between them is easy. The remaining task is to get a numeric value from the first "word" in var1. You could then do:
data have;
input var1 $12. var2;
datalines;
2 months 150
two months 90
1 week 30
1 week 45
2 months 100
2 months 220
run;
%let weeks_per_month=%sysevalf((365/7)/12);
data want (/*drop=_:*/);
set have;
array numwords {12} $6 _temporary_ ('one','two','three','four','five','six',
'seven','eight','nine','ten','eleven','twelve');
_nunits=whichc(lowcase(scan(var1,1)),of numwords{*});
if _nunits=0 then _nunits=input(scan(var1,1),2.);
if index(lowcase(var1),'month') then weekly_var2= var2/(_nunits*&weeks_per_month);
else weekly_var2=var2/_nunits;
run;
This allows you to have "one month", "two months", ... "twelve months" to start var1 (or "one week" through "twelve weeks"), as well as any set of (up to) 12 digits.
... View more