BookmarkSubscribeRSS Feed
u57961979
Calcite | Level 5

Hello, I need your help, I have to create 2 tables, in the first one I have all the data of the insurance policies with the due payments, in the other I have the quotas that belong to the company to pay (percentages).


when i apply
date db_pol;
merge db_polices_total (in=a) quota_share (in=b);
by catena;
if a;


which works, but if I have 2 policies with the same number, only the first line is populated, the second one does not receive the corresponding quota.

2 REPLIES 2
Astounding
PROC Star

First thing to check for:  does your db_policies_total data set already contain a percentages variable before the merge.  If that's the problem, you can get rid of it using:

date db_pol;
merge db_polices_total (in=a drop=percentages) quota_share (in=b);
by catena;
if a;

Of course, I don't know  your variable names.  You would have to use the proper name that exists in your data.

ballardw
Super User

@u57961979 wrote:

Hello, I need your help, I have to create 2 tables, in the first one I have all the data of the insurance policies with the due payments, in the other I have the quotas that belong to the company to pay (percentages).


when i apply
date db_pol;
merge db_polices_total (in=a) quota_share (in=b);
by catena;
if a;


which works, but if I have 2 policies with the same number, only the first line is populated, the second one does not receive the corresponding quota.


Which variable has the policy number? Do both data sets have multiple values of the same number?

It may help to show us the LOG from running your code. Copy the log text including the code and all messages from that data step. On the forum open a text box with the </> icon above the message window and paste the text.

 

PS: you misspelled Data as Date above.

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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 716 views
  • 0 likes
  • 3 in conversation