Converting program "line by line" is seldom a good idea.
It's better to find out the major business rules, and try to reproduce the output building from scratch.
If you intend to phase out a SAS solution to SQL Server, I don't think you will get much detail support here, since most people here are SAS supporters...;-)
... View more