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.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 593 views
  • 0 likes
  • 3 in conversation