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

Hello,


There are different string variables from different months of data that I'm trying to pull to create one sheet of data where there aren't duplicate rows of data.  When I do this through a case statement or joining data a blank row shows up for where it does not agree. For example, if someone has two different managers in October and November I want the employee to show only one row of data and have an "October Manager" column and a "November Manager" column.  I know that when using numbers you can simply sum the info but with string variables it's proving to be more challenging. I've included a picture that will hopefully shed some light on what I'm looking for.

 

Thanks for any help.

 

 SAS_Question.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Read the data into SAS.  Use retain variables to create retain values on the manager columns (or you could transpose the data, sort not missing, then transpose again.  Or in fact merge the non-missing row to non-missing row).  Then join the data.  Then output again.  Plenty of examples on here already on how to line up data.  If you provide test data in the form of a datastep of all the relevant datasets, I can supply some code, but not here to type in test data.

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

 

 

View solution in original post

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Read the data into SAS.  Use retain variables to create retain values on the manager columns (or you could transpose the data, sort not missing, then transpose again.  Or in fact merge the non-missing row to non-missing row).  Then join the data.  Then output again.  Plenty of examples on here already on how to line up data.  If you provide test data in the form of a datastep of all the relevant datasets, I can supply some code, but not here to type in test data.

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 1479 views
  • 0 likes
  • 2 in conversation