Help using Base SAS procedures

SAS_ data repeat read please help me

Reply
Occasional Contributor
Posts: 12

SAS_ data repeat read please help me

I have raw data like this

time ID01 ID02 ID03 ~ IDxx

0    10    11  xx

0.5  20    12  xx

1    29    25  xx

1.5  41    30  xx

2    50    40  xx

3    30    50  xx

4    40    42  xx

I want to make it to this form

x time temp.

01 0 10

01 0.5 20

01 1 29

01 1.5 41

01 2 50

01 3 30

01 4 40

02 0 11

02 0.5 12

02 1 25

02 1.5 30

02 2 40

02 3 50

02 4 42

I used array statement and proc transpose

but I can't repeat time variable beside temp.

Please Help me.

Contributor
Posts: 29

Re: SAS_ data repeat read please help me

Hi, hope below code will solve your problem.

proc transpose data=want out=have;

by time;

  var ID01 - IDXX;

run;

data final;

  set have;

   X=substr(_name_,3);

    drop _name_;

      rename col1=temp;

run;

proc sort data=final;

by X;

run;

Sudeer  

Ask a Question
Discussion stats
  • 1 reply
  • 149 views
  • 1 like
  • 2 in conversation