While I do have access to EXPAND and consider it a very useful procedure, this is how I would code…