Hi:
A clarification, please. You said:
I open my temporary library (work) find the dataset test1, double click and straight away I can see it open in a spread sheet...without formats assigned, which means I only see the values 1 and 2, instead 1 Pilot Cohort, 2 Main Cohort.
You mean you open the WORK version of TEST1 in SAS Viewtable mode???? Not in an Excel spreadsheet????
If you DO mean an Excel spreadsheet, how are you creating the file for Excel?? Are you using ODS or choosing the "View in Excel" choice from the drop-down menu? What about the PROC TABULATE output?? Do you care about the TABULATE output or only about WORK.TEST1??
When I try code similar to your code, I see the user-defined format being used in Viewtable mode when I look at WORK.TEST1 -and- being used in Excel, if I choose menu option "View in Excel". Code I tried is below. The only thing different is that I create LBWSAM01 in my code from SASHELP.CLASS -- whereas in your code, you must have LBWSAM01 in your SET dataset.small file.
You may have reached the point where you need to work with Tech Support on this issue. They can look at your data, ALL your data, at your SAS logs and you can send them screen shots of what you're seeing or not seeing in Viewtable mode.
To open a track with Tech Support, fill out the form at this link:
http://support.sas.com/ctx/supportform/createForm
cynthia
[pre]
proc format;
value LBWSAM01F
1 = '1 Pilot cohort'
2 = '2 Main cohort' ;
RUN;
DATA test1 ;
SET sashelp.class;
if sex = 'F' then lbwsam01 = 1;
else lbwsam01 = 2;
KEEP lbwsam01 sex name;
FORMAT lbwsam01 lbwsam01F.;
RUN;
Proc TAbulate data=test1;
class lbwsam01;
table lbwsam01;
RUN;
Proc contents data=test1;
Run;
[/pre]