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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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