05-10-2018 10:35 AM
Do anyone know if first.variable/last.variable can be used to transpose data? For instance, I want to transform a long list of character variables to a single list by a group. Does that make sense and is this possible? Thanks!
05-10-2018 10:41 AM
No, they can't be used since they are not saved in the data set. They are temporary variables only.
Choices abound. The DATA step could copy the first. and last. variables to new variables which could be used later. Or, PROC TRANSPOSE could use a BY statement (perhaps the same BY statement that appears in the DATA step).
05-10-2018 11:05 AM
Just a follow-up note .... it depends on how you plan to transpose. PROC TRANSPOSE is out. But there are ways to transpose data using a DATA step. If that's the route you are taking, you can use the BY variables in the same DATA step.