BookmarkSubscribeRSS Feed
Wouter
Obsidian | Level 7
Hello all,

I'm a newbee at SAS, and I'm struggling with the following problem.

I've created 1 table with dates, like

2008-01-01
2008-01-02
2008-01-03
etc.

And I've got another table with customer id's, incident dates and incident id's, like

Customer_id | Incident dates
123 | 2008-01-02
123 | 2008-01-05
126 | 2008-01-05
128 | 2008-05-03
128 | 2008-05-28
128 | 2008-06-01
etc.

What I want to create is a list per Customer ID, which overlays the first dates table (sort of outer join, but per customer), so the dates table stays intact (I try the merge statement, but this don't leaves the dates table intact). So this will create a huge table, because all the customers have there own list (I like to have all lists below each other. Like:

For Customer ID 123 the list will be:

2008-01-01 |
2008-01-02 | 2008-01-02
2008-01-03 |
2008-01-04 |
2008-01-05 | 2008-02-05
2008-01-06 |
Then, the following customer ID and so on.

I tried several hours to make this work (DO Loops, merges, etc), but I can't figure it out. Maybe anyone can help me? Really thanks in advance!!!
1 REPLY 1
deleted_user
Not applicable
This looks more like a cross join and if that it is your logic, you could use proc sql.

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 846 views
  • 0 likes
  • 2 in conversation