BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

I want to transpose the data and how I have and want. Is it possible? dates/time are in datetime16. format in have datasets. I really appreciate any help you can provide.

SASuserlot_0-1707933608354.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

From now on, even in this small example, would you please provide data not as screen captures but as text in the form of working SAS data step code? (examples and instructions) Thank you. We cannot work with data in a screen capture.

 

Here is the idea that ought to get what you want on your data. I use a different data set because I cannot work with data in a screen capture.

 

proc transpose data=sashelp.class(obs=1) out=want prefix=all;
    by name;
    var height weight age;
run;

 

 

Adding: it makes sense (to me) to have dates in a column. It does not make sense (to me) to also have the value of COUNT in the same column as date, and so I would suggest you re-think the layout that your want.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

From now on, even in this small example, would you please provide data not as screen captures but as text in the form of working SAS data step code? (examples and instructions) Thank you. We cannot work with data in a screen capture.

 

Here is the idea that ought to get what you want on your data. I use a different data set because I cannot work with data in a screen capture.

 

proc transpose data=sashelp.class(obs=1) out=want prefix=all;
    by name;
    var height weight age;
run;

 

 

Adding: it makes sense (to me) to have dates in a column. It does not make sense (to me) to also have the value of COUNT in the same column as date, and so I would suggest you re-think the layout that your want.

--
Paige Miller
SASuserlot
Barite | Level 11

@PaigeMiller  My apologies; my sample code has not shown up here for some reason. Maybe I did not paste it correctly and just submitted a query. I realized that with your responses. Thanks for helping out. I resolved the issue, Just doing two transposes, one for 'dates' and one for 'count'', then appended.

Thanks.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 343 views
  • 1 like
  • 2 in conversation