BookmarkSubscribeRSS Feed
mmkr
Quartz | Level 8

could one of you please help me on the below ?

Input is on left side and output is on rigth side !!

 

proc report iam trying but it is not working when it is on blank rows (col4).

 

Intput                output              
  Name  Age col1 col2 col3 col4 col5   Name  Age col1 col2 col3 col4 col5
  ABC 25 bus1 cat1 dog1   pig1   ABC 25 bus1 cat1 dog1   pig1
      bus1 cat1 dog1   pig2               pig2
      bus1 cat1 dog1   pig3               pig3
      bus1   dog1   pig4               pig4
      bus1       pig5               pig5
  DEF 25 bus1 cat1 dog1 frog1 pig1   DEF 25 bus1 cat1 dog1 frog1 pig1
      bus1 cat1 dog1 frog2 pig2             frog2 pig2
      bus1 cat1 dog1   pig3               pig3
      bus1   dog1   pig4               pig4
      bus1       pig5               pig5
1 REPLY 1
ballardw
Super User

Data?

That stuff on the left is does not make sense.

And your desired(?) output doesn't make sense either as it clearly shows that Col2 =Cat1and Col3=Dog1 are associated with multiple values of Col5. Cat1 is associated with pig1, pig2 and pig3. Dog1 is associated with pig1, pig2, pig3 and pig4. So the result does not make sense.

 

What is the LOGIC, as in rules, involved here?

And please provide a starting data set in the form of working data step code.

From what you show I suspect you have already manipulated data and possibly made it harder to accomplish the desired goal.

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