![]() ![]() Once the file is created, you can keep the existing comments or change them. Then, the next step is an ODS TAGSETS.EXCELXP step that has 2 PROC REPORT steps inside the ODS "sandwich": 1) printing the data in SASHELP.CLASS and then 2) making a second tab with the comments. So here's a code example where the first program makes a SAS dataset using a DATA Step program to make the "comment" dataset, with 2 "rows" of comments. Without going down the SAS Macro Language or CALL EXECUTE road, I prefer to start with simpler syntax. ![]() I usually don't want the people who see my reports to see my code. My tendency is to follow a naming convention, like putting the program name in a footnote or naming the report the same name as the program that created it. Not that it's hard, but it is a lot of overhead to go to in order to put your code into the Excel worksheet. Infile "c:\temp\mycodefile.sas" length=lg Īnd then you need to use PROC PRINT or PROC REPORT to display what is in the WORK.THISCODE dataset and get it into a worksheet. Now, you need to read this program into a SAS dataset so you can "print" or display it using PROC PRINT or PROC REPORT: However, if EG is creating the code on the fly and you are just running the code created in the project, then that is a harder task.Ĭonsider the following program, stored in a file called c:\temp\mycodefile.sas (without ANY ODS statements in the code): If you know the name of the SAS code file, then yes, you can read it and "print" it to a sheet in the Excel file. I'm not entirely sure what you mean by "sending the SAS code to the Excel code sheet". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |