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
|
title 'Test MODIFY VARS, RENAME VARIABLES'.
/* Note that these are not quite in alphabetic order.
data list /a b c d e f g h i j k m n o p l q r s t u v w x y z 1-26 (a).
/* Dummy data that's not actually examined.
begin data.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
NOPQRSTUVWXYZABCDEFGHIJKLM
end data.
/* This should display z y x w s q p n m l k j i h t7 t6 t5 t4 t3 t2 t1.
modify vars /reorder=backward alpha/drop o r t u v/rename (a to g=t1 to t7).
display var.
/* This should display z y x w s q p n m l x14 x13 x12 x11 t1 t6 t5 t4 t3
/* t2 t7.
rename variables (t1=t7)(t7=t1)(h i j k=x11 to x14).
display var.
/* The command below should fail with an error message.
rename variables (t1=t2)(t2=t2).
/* This should display y x w s q p n m l x14 x13 x12 x11 t1 t6 t5 t3 t7.
modify vars /reorder=forward positional/keep y to t5 t3 x14 t7.
display var.
/* This should display t7 x11 q s x y. */
modify vars /reorder=backward positional/keep x s y x11 t7 q.
display var.
|