BookmarkSubscribeRSS Feed
COLDORANGE
Calcite | Level 5

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.

1 REPLY 1
Chrishi
Calcite | Level 5

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  

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 945 views
  • 1 like
  • 2 in conversation