1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Solution ID:	 	100000844	
Product:	 	SPSS Base 	
Title: 			Getting TIME (and date) printed before a procedure 
Description:
Q. 
I need to print the date and time at the top of a procedure. How can 
I do this? 
A. 
This is simple enough to do. The basic syntax is: 

DO IF $CASENUM=1. 
PRINT /$TIME (DATETIME). 
END IF. 
* need a procedure here *. 

*To keep from repeating these three lines every time the date/time is 
needed it is best to place this in a macro . 
DEFINE @DATEIT ( ) . 
DO IF $CASENUM=1. 
PRINT /$TIME (DATETIME). 
END IF. 
!ENDDEFINE. 

SET HEADERS OFF. 
DATA LIST FREE / A . 
BEGIN DATA 
1 2 2 3 1 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 
end data . 
* The following illustrates how to use the macro * . 
@DATEIT . 
FREQ A. 
@DATEIT. 
DESC A.