BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
einstein
Quartz | Level 8

In Stata, when you have your output, it also shows you the code you used to produce the output.

 

Is there a similar feature that can be utilized in SAS?

 

So that you can see the sas code with the output together?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Tim_SAS
Barite | Level 11

You can use PROC DOCUMENT's IMPORT TO statement to import a text file into an ODS DOCUMENT, and then replay it to the listing or any other ODS destination such as a web page or PDF file. Here's an example.

View solution in original post

5 REPLIES 5
Reeza
Super User

Not easily. Recently they've added support for Jupyter notebooks so that would give you what you want:

 

http://blogs.sas.com/content/sasdummy/2016/04/24/how-to-run-sas-programs-in-jupyter-notebook/

RW9
Diamond | Level 26 RW9
Diamond | Level 26

SAS code is just text, you could read it in in a datastep infile.  Then proc report it out after the output.

Ksharp
Super User

Or put the following code at the end of your code.


data _null_;
 file print;
 infile '/folders/myfolders/temp.sas'  lrecl=32767;
 input;
 put _infile_;
run;


Tim_SAS
Barite | Level 11

You can use PROC DOCUMENT's IMPORT TO statement to import a text file into an ODS DOCUMENT, and then replay it to the listing or any other ODS destination such as a web page or PDF file. Here's an example.

einstein
Quartz | Level 8

Thank you!  This worked!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 691 views
  • 0 likes
  • 5 in conversation