BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes, you would need to sort it, sorry, I should have thought of that - its what happens if I can't test things.  Put your rename on the datastep - also note how I use the code window which is the {i} above the post area, and format my code for readability - i.e. avoid using mixed case.  A final point, it seems to me like the requirement changed somewhere, are you now saying that there is a variable in the data which holds the year value?  If so then we can simplify it:

/* Step 1 - set all data together, and put year in as a data item */
data inter;
  set hyptabs.src_utah_vitals: ;   /* See here I use : to mean all datasets with that prefix */
run;

proc sort data=inter;
by apptdata;
run; /* Transpose the data */ proc transpose data=inter out=want; by year; var value; idlabel measure; run;

data want;
set want (rename=(apptdate=visitdt ssn=ssn1 col1=htln ...));
run;

 

 

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

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3504 views
  • 0 likes
  • 4 in conversation