Is there a way to delete selected rows from a Data extension(MASTER\_DE) by looking up another data extension as a lookup (to identify the subscriber keys that need to be deleted) using SSJS?

I have found some blogs to delete all the data but not selected rows. 

Basically, I have a client who doesn't have data retention policy applied to DE's and you can't add data retention policy once it's created. so I was trying to create a way to delete any records that are older than 3 months through an automation.