186 Handbook of SAS
®
DATA Step Programming
Transposing BY-group with the COPY statement
Obs s_name s_id varname TEST COL1
1 John A01 e1 English1 89
2 John e2 English2 90
3 John e3 English3 92
4 Mary A02 e1 English1 92
5 Mary e2 English2 .
6 Mary e3 English3 81
10.3.3 Where the ID Statement Does Not Work
for Transposing BY Groups
You can use the ID statement to specify the variable from the input data set
that contains the values to use for renaming transposed variables. In Program
10.9, the newly created transposed variable is given the uninformative name
of COL1 by default. However, if you want to use the S_ID variable in the ID
statement to change COL1, the results from Program 10.10 won’t conform
to your expect ...