Hi:
VLOOKUP is generally when you have information on one sheet that is used to "expand" or "translate" information on another sheet, right???
So let's say on one sheet, I had this:
[pre]
K Kermit
E Elmo
O Oscar the Grouch
B Big Bird
[/pre]
and then on another sheet, I wanted to translate the K, E, O, B to their expanded values.
In SAS, you do this kind of translation with a user-defined format....and you would use the format BEFORE you sent the results to Excel. So, for example, if I had a format for the AGE variable in SASHELP.CLASS, I can use that format in SAS procedures to expand the value of AGE before the output is opened with Excel. In the program below, the PROC FORMAT step builds the format and then in the PROC FREQ and the PROC REPORT, the format is used in each step. The PROC REPORT step shows the unformatted value for age and the formatted value for age in the same report.
You can even build your format from a SAS dataset or external file, if you look up the FORMAT documentation on using CNTLIN.
cynthia
[pre]
proc format;
value agef 11='Still a Kid'
12='Early Teenager'
13='Just Starting as a Teenager'
14='Really a Teenager'
15='Trying to Drive'
16='Driving and still a Teenager';
run;
ods tagsets.excelxp file='c:\temp\students.xls' style=sasweb;
proc freq data=sashelp.class;
tables age;
format age agef.;
run;
proc report data=sashelp.class nowd;
column name age age=agefmt sex height weight;
define name / display;
define age / display;
define agefmt / display 'Format Applied' f=agef.
style(column)={just=l cellwidth=1.5in};
run;
ods tagsets.excelxp close;
[/pre]