Repeat number

#1
Hi all!!!

Currently I working with SPSS to analysis and I have the problem the following:
I have my dataset long shape like:
serial relationship
1 Head
2 spouse
3 child
4 child
1 head
2 spouse
3 child
4 relation
.
.
.
so on
My question: how create new variable (ID) to repeat number from 1 to 4 at first household and repeat number 2 from 1 to 4 at second household base on the serial number as I mention above?