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.
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;
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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.