/* This is an example of changing one existing variable, based on the value of another existing variable. It also shows how you can change a character variable to numeric. 17 Jul 96 -- sas.help@umich.edu */ /* The numeric variable that is created has 2 places after the decimal, because I gave the format as 8.2. If you wanted no places after the decimal, you could give the format as 8.0 or 4.0 or something like that. You can also create character from numeric in a similar manner. You just need to use the right character format. For example -- $8. */ data example; input casenum los charvar $; datalines; 1 25 0128 222 0 5973 ; proc print data=example; title 'printout of original example dataset'; run; data new; set example; if casenum=222 then los=1; numvar=input(charvar,8.2); drop charvar; run; proc print data=new; title 'printout of new dataset'; run;