BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS_inquisitive
Lapis Lazuli | Level 10

Hello,

 

I have a data structure like this.

 

id time test_1 test_2

1   1     4       8

1   2     5       6

1   3     4       7

2   1     5       8

2   2     4       5

 

I want like this.

id time test     value

1  1    test_1    4

1  1    test_2    8

1  2    test_1    5

1  2    test_2    6

1  3    test_1    4

1  3    test_2    7

2  1    test_1    5

2  1    test_2    8

2  2    test_1    4

2  2    test_2    5

 

thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Post test data in the form of a datastep.  As such this is just an example:

proc transpose data=have out=want;
  by id time;
  var test_:;
run;

View solution in original post

3 REPLIES 3

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 858 views
  • 4 likes
  • 4 in conversation