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...

 

 

 

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!
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.

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