Hello,
I have the following final table (every day the table contents change):
Date | Bank_ID | Branch_ID | Account_Number | Credit_Card | Credit_Card_Group | ID_number | Mail_To |
01/10/2020 | 20 | 1 | 1234567 | 2234 | pix | 4432252 | pix@gmail.com |
01/10/2020 | 20 | 112 | 3224334 | 3424 | pix | 2552367 | pix@gmail.com |
01/10/2020 | 20 | 1 | 1234567 | 5677 | lum | 4432252 | lum@gmail.com |
01/10/2020 | 20 | 34 | 2344523 | 4545 | lum | 3656890 | lum@gmail.com |
01/10/2020 | 20 | 1 | 1234567 | 4299 | pix | 4432252 | pix@gmail.com |
I would like to send an email to each record in the table that the combination of the fields is an Account_Number and a Credit_Card_Group is different.
According to the example, I will send 4 emails.
The Email:
From: freetalk@gmail.com
To: <Mail_To>
Subject: Closing <Account_Number> - <Branch_ID>
Email content:
<Credit_Card_Group> , <Date>
Cancel any instructions in the account <Account_Number> - <Branch_ID> -<Bank_ID>
credit cards-
1.<Credit_Card> - <ID_number>
2. <Credit_Card> - <ID_number>
Thanks.
Example of an email from the table:
From: freetalk@gmail.com
To: pix@gmail.com
Subject: Closing 1234567 - 1
Email content:
pix, 01/10/2020
Cancel any instructions in the account 1234567 - 1 - 20
credit cards-
1.2234 - 1234567
2.4299 - 1234567
Thanks.
I would appreciate your help.
UP
@shlomiohana - To get a better response I suggest you post what you have tried so far. Many contributors like to see an attempt before they reply.
Please provide data in usable form, if you want to see working code.
Hints: sort the data by Mail_To an Account_Number, then use by-group-processing in a data-step.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.