Posts

Showing posts with the label Prefix

PROC TRANSPOSE: How to Convert Variables(columns) into Observations(ROWS) and Observations(ROWS) into Variables(Columns)

Image
During my early days as a SAS programmer, I used to get confused which statement in PROC TRANSPOSE used for what and why? PROC TRANSPOSE syntax looks like a straightforward thing, but we need to look at important details it offers and without that we may get unexpected results. Proc Transpose Options: Proc Tranpose offers several options like OUT=, LABEL=, NAME=, and PREFIX=. Each option is distinct from the others. "OUT=" option assigns an output dataset, "LABEL=" option assigns a nemae to the variable which has the label of the transposed variable. If we don’t use "LABEL=" option in the PROC TRANSPOSE syntax, the defalut “_LABEL_” will be assigned to the variable that is being transposed. "NAME= " option works same as the "LABEL=" option, as if we use NAME=option in the TRANSPOSE syntax, which will assign the name to the variable that is being tranposed. There is another option that we can use in the TRANSPOSE syntax that ...