1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
* Syntax to group data in bands.
* rlevesque@videotron.ca.

*I note that your variable is a string.

* Use dummy data for demonstration purposes.
DATA LIST FREE /income(A16).
BEGIN DATA.
'25000' 'not applicable' '35000' '36000' '37000' 'not applicable' '26200'
END DATA.

RECODE income (CONVERT) INTO incom2.
* To group incom2 into bands of 5000 wide use following.
COMPUTE incom3=TRUNC(incom2/5000)-3.

* or proceed as follows.
RECODE incom2 (LO THRU 24999=1) (25000 THRU 29999=2) (30000 THRU 34999=3)(35000 THRU HI=4) INTO incom4.
EXECUTE.