#### anand_ger

##### New Member
Hi I have just started working on SAS and I am a beginner..
for ex:

I have

PID 1 2 3 4 5 6 7 8
patient a b c d e f g h
room 001 002 003 004 005 006 007 008

I want to have it like

PID Patient Room
1 a 001
.
.
.
.
8 h 008

#### Con-Tester

##### Member
I’m going to assume that your first column (“PID”, “patient”, “room”) is called “VarName”, that the remaining eight columns are called “X1”, “X2”, … “X8” and that all the columns are text variables, not numeric. They are in a SAS dataset called “Test”. The following code should produce the desired result in a new dataset called “Test_T”:
Code:
proc transpose data = Test out = Test_T (drop = _NAME_);
id  VarName;
var X1 X2 X3 X4 X5 X6 X7 X8;  /* NOTE: Could also use "var X1-X8;" */
run;

#### anand_ger

##### New Member
Thank you so much con tester...

QUOTE=Con-Tester;153059]I’m going to assume that your first column (“PID”, “patient”, “room”) is called “VarName”, that the remaining eight columns are called “X1”, “X2”, … “X8” and that all the columns are text variables, not numeric. They are in a SAS dataset called “Test”. The following code should produce the desired result in a new dataset called “Test_T”:
Code:
proc transpose data = Test out = Test_T (drop = _NAME_);
id  VarName;
var X1 X2 X3 X4 X5 X6 X7 X8;  /* NOTE: Could also use "var X1-X8;" */
run;
[/QUOTE]