BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom
Super User Tom
Super User

PROC TRANSPOSE creates the new variables as it sees values for them.  Since you are doing the transpose BY some variable the only way to insure it will create them in the order you want is to make sure the first BY group has ALL of the dates. So please re-read and study the code that @data_null__ posted.  That will insure that all of the dates exist in the first group and so that PROC TRANSPOSE will create them in the order you want.

 

Also if you are going to use dates as text, such as in the names of variables, then ALWAYS use year-month-day order so the character strings will sort in proper date order.  Note that this also has the advantage of not confusing your European friends into wondering how you could possible have a date with month number of 31.

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

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 15 replies
  • 10939 views
  • 6 likes
  • 5 in conversation