PROC TRANSPOSE can be used to "rotate" (transpose) SAS® data sets. I.e. the values of one given variable become variable names and variables in the input data set become observations in the output. The answers to three simple questions suffice to define the specification statements of PROC TRANSPOSE.
PROC TRANSPOSE is controlled by three specification statements: the ID statement, the VAR statement and the BY statement. The variables to be declared in these statements can be determined with the help of a few simple questions: Which variable in the input data set contains (after formatting!) the variable names of the output data set?
One of the groups is the indicator of debt across years. The approach is the same with either numeric variables or character variables. Since there are three groups of variables, we need to use proc transpose three times, one for each group. Then we merge them back together.
A simple approach here is to transpose one group of variables at a time and then merge them back together. In the data step where we merge the transposed data sets, we also create a numeric variable year based on the SAS automatic variable _NAME_ from the second transposed data set.