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
* Define variable label by macro.
* rlevesque@videotron.ca.

DATA LIST LIST /id.
BEGIN DATA
1 
END DATA.

NUMERIC pw1 TO pw4 bp1 TO bp4.

SET MPRINT=yes.
DEFINE !label (lab=!TOKENS(1) 
		/stem=!TOKENS(1)
		/nb1=!TOKENS(1)
		/nb2=!TOKENS(1))
!DO !cnt=!nb1 !TO !nb2
!LET !var=!CONCAT(!stem,!cnt)
!LET !labe=!QUOTE(!CONCAT(!UNQUOTE(!lab),!cnt))
VARIABLE LABEL !var !labe.
!DOEND.
!ENDDEFINE.


!label lab='Blood Pressure - Week ' stem=bp nb1=1 nb2=4.
!label lab='Patient  Weight - Week ' stem=pw nb1=1 nb2=4.