my control dataset named datanames with 5 variables as follows: memtype libname memname sic state DATA WORK AL61 61 AL DATA WORK AL62 62 AL DATA WORK AL71 71 AL DATA WORK AL81 81 AL DATA WORK AL91 91 AL DATA WORK AK61 61 AK DATA WORK AK62 62 AK DATA WORK AK71 71 AK DATA WORK AK81 81 AK DATA WORK AK91 91 AK DATA WORK KY61 61 KY DATA WORK KY62 62 KY DATA WORK KY71 71 KY DATA WORK NM61 61 NM DATA WORK NM62 62 NM DATA WORK NM71 71 NM DATA WORK NM81 81 NM DATA WORK NM91 91 NM variables memname, state and sic are all character variables; my original sas datasets imported from excel do not include the two variables: state and sic but the names of datasets contain the information:the first two letters are state initials and the digits followed are sic codes. Now I want to add the two variables to the sas datasets. with state as character variable and sic as numeric. My macro program and call excute codes are as follows: %macro addvar(state,sic); data &state&sic; length state $ 2.; set &state&sic; state="&state"; code=input("&sic",8.) run; %mend addvar; data _null_; set datanames; call symput('state',state); call symput('sic',sic); call execute(cats('%nrstr(%addvar)(',state,sic,')')); run; When I run the above codes, I got the variable state with values the same as the variable memname, and code with values missing. I don't know why?