Hi:
You said you wanted to apply a format to your CLASS variable. TIME is not your CLASS variable -- you have TIME on the VAR statement, so it is an ANALYSIS variable. I do not believe you can apply a format to the calculated statistics with a FORMAT statement.
The FORMAT statement in your code is incorrect if you want to apply a format to the CLASS variable. That syntax would be:
[pre]
format PLACE $fmtname.;
[/pre]
You might want to read the documentation on working with DATE and DATETIME and TIME variables. It may not be appropriate to format all the calculated statistics with time formats, depending on what your dates/times represent -- as described in this Tech Support note:
http://support.sas.com/techsup/technote/ts668.pdf
Since a time-based variable represents the number of seconds since midnight (or the number of seconds before or after midnight on Jan 1, 1960 if you have a DATE/TIME variable), you might want to pay special attention to the implications of this information from the above Tech Support document:
[quote]
SAS times are a count of the number of seconds since midnight. They can and often do contain decimal values representing fractions of a second. The range of values is 0 <= sas time < 86400. A SAS time variable having a value of 60 is 1 minute after midnight. 12:00 noon would be stored internally as 43200. midnight is stored as 0. If a SAS time variable has a value larger than 86400, different formats treat the value differently.
[endquote]
It might be OK to format the calculated MIN and MAX with the TIME format, but it may or may not be appropriate to format the MEAN or STDDEV or STDERR with a TIME format.
One thing you can do is capture the output from PROC TTEST in a SAS dataset and then use PROC PRINT to print the numbers using the format that is most appropriate. The other alternative is to change the table template used for PROC TTEST -- this is probably the more complicated approach and would require a steep learning curve compared to PROC PRINT.
To save the output with MIN, MAX and MEAN from PROC TTEST, use the ODS OUTPUT statement. I believe the output object of interest is the STATISTICS output object. The program below shows how to create an output object from the TTEST procedure. The ODS TRACE statement puts output object information into the SAS log -- if the STATISTICS output object is not the one you want, then you can examine the other output objects using similar syntax, once you pick the output object name of interest.
cynthia
[pre]
ods trace on / label;
ods output statistics=work.tstat;
proc ttest data=one;
class PLACE;
var time;
run;
ods trace off;
proc contents data=work.tstat;
title 'What is in the Output dataset';
run;
proc print data=work.tstat;
title 'Use the appropriate format here';
format mean minimum maximum time8.;
run;
[/pre]