Hi:
If all you want are these simple formats for your date/time value, then you do not need to calculate those values in a compute block. You can do this with PROC REPORT:
[pre]
data mystuff;
infile datalines;
input name $ bday : datetime18.;
return;
datalines;
alan 15nov1950:07:53:45
bob 11oct1960:15:23:17
carl 23aug1958:10:18:34
;
run;
proc report data=mystuff nowd;
column name bday bday=time;
define name / display 'Name';
define bday / 'Birth Date' display f=dtdate9.;
define time / 'Birth Time' display f=tod10.;
run;
[/pre]
And you will get this output in the LISTING window:
[pre]
Birth
Name Date Birth Time
alan 15NOV1950 07:53:45
bob 11OCT1960 15:23:17
carl 23AUG1958 10:18:34
[/pre]
PROC REPORT allows the use of "aliases" in the COLUMN statement. So on this report, you would use the BDAY variable two times on the report row. The first time BDAY appears in the COLUMN statement, it appears with its own variable name. That means that the second time BDAY appears in the COLUMN statement, you are telling PROC REPORT that you need to use it a second time on the report row. To have a single variable appear more than one time on a report row, however, PROC REPORT expects that you will provide an ALIAS for the second (or third or fourth) usage. That's what the BDAY=TIME means in the COLUMN staement. So the first BDAY will be formatted using the DTDATE9. format (which will format only the DATE portion of a date/time variable value) and then the report item called TIME, (which is just an alias for BDAY) will be formatted with the TOD10. format.
It is only if you wanted OTHER date formats for BDAY that you would need to calculate a new column and use a COMPUTE block. An example of that code (but not the output is below).
cynthia
[pre]
ods listing;
proc report data=mystuff nowd;
column name bday calcdate bday=time ;
define name / display;
define bday / display noprint;
define calcdate /computed f=mmddyy10.;
define time / 'Birth Time' display f=tod10.;
compute calcdate;
calcdate = datepart(bday);
endcomp;
run;
[/pre]