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.

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
  • 15 replies
  • 8525 views
  • 6 likes
  • 5 in conversation