I am fairly new to SPSS. I am trying to write a macro where "time" will be passed as an argument. I want to recode it into another macro variable "t2". I can do it in the following way:
DEFINE !my_macro (time = !TOKEN(1))
!LET !t2=" ".
!IF (!time >=2 & !time <2.5) !THEN !LET !t2=1. !IFEND.
!IF (!time >=2.5 & !time <3) !THEN !LET !t2=2. !IFEND.
!IF (!time >=3 & !time <3.5) !THEN !LET !t2=3. !IFEND.
...
The problem is I have so many of these intervals. Just wondering if there is any one line of code that will recode a macro variable into another macro variable?