04-30-2016 03:25 PM
I'm trying to find a way to output the actual .sas program into an excel tab. Is there a way to do this?
If my pretend.sas program consists of
Then I want to export this into excel as
Tab name: Pretend_sas
Starting in row A, Column 1 put
04-30-2016 04:24 PM
04-30-2016 04:39 PM
You'll need a saved version of the file to export. Then you could read it in as an infile and export to a tab in the sheet.
Excel has cell limits for text that you might run into, so you also need to make sure it doesn't truncate your code.
Maybe include a link to the saved program instead in a sheet?
I used to do this with my SQL queries for reproducibility but we also tracked projects by ID number. There are other ways to ensure reproducibility than, ie Source Control and project tracking. All of them depend on user adherence.
05-01-2016 03:58 AM
Yes. Transform your SAS program file into SAS Dataset ,and then export it as Excel. CODE NOT TESTED: data code; infile 'c:\mycode.sas' length=len lrecl=800; input code $varying800. len ; run; proc export data=code outfile='c:\myexcel.xls' dbms=excel replace; sheet='Pretend_sas'; run;