In reply to Tom Abernathy.

Hi Tom, thank you for your input. Yes, it is kind of similar, but, no, %embed(C:\project\query1.sql) is NOT the same as %unquote(%fread(C:\project\query1.sql)). By looking into the %FREAD macro implementation (MODE=1), I can see that this macro returns external file lines in form of %LET statements. After that, to embed the external file into SAS program one would need to reference all the created macro variables thus requiring another loop through all of them: &&W&i.

In my view %embed( ) macro function is much simpler and clearer solution, allowing to embed external code file in a single macro reference.