Hi,
I have a dataset that looks like this
Id amount pay_type expire_date
001 -7,3 1 17/01/2008
001 -15,1 1 .
001 -15,1 1 .
001 15,1 2 03/05/2015
001 15,1 2 09/11/2019
002 -8,6 1 .
002 8,6 2 08/12/2018
I need to put in the pay_type 1 missing expire_date values the value of an expire_date of a pay_type 2 with same id and absolute amount, also, pay_type 2 can only give her expire_date once so in the posted example the dates of the two first missing values should be 03/05/2015
and 09/11/2019, the third missing value of id 002 should be 08/12/2018.
Thanks in advance.
Show us the desired output in a table similar to the one you provided with the input data.
Sure, the expected result table should look like this:
Id amount pay_type expire_date
001 -7,3 1 17/01/2008
001 -15,1 1 03/05/2015
001 -15,1 1 09/11/2019 .
001 15,1 2 03/05/2015
001 15,1 2 09/11/2019
002 -8,6 1 08/12/2018
002 8,6 2 08/12/2018
Apparently i can´t since its considered a form of spam, but must be something like:
expire_date
17/01/2008 001
03/05/2015 001
09/11/2019 001 .
03/05/2015 001
09/11/2019 001
08/12/2018 002
08/12/2018 002
Every pay_type 2 has copied hew expire date only to one pay_type 1 with same absolute amount and same id.
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.