BookmarkSubscribeRSS Feed
ibaphd
Calcite | Level 5

I'm sure I'm not thinking of the correct keyword for searching, but I cannot find the answer to this simple question:  How do I write text at then end of my output?  For example, say my output consists of tables and at the end I want to write (in words) a summary of the results of that table.

 

I understand that I would have to go back and re-run the program after I find out what the results are, but what statement do I use, and where do I include it, so that the text is written at the end of the output?  I do not want to write a footnote because that will be printed at the bottom of each page.

 

I work in the Windows environment (v. 9.4) and I import my data so I don't know how I could include it in the data step.

 

Thanks!

8 REPLIES 8
Reeza
Super User

Are you using an ODS destination?

 

You can look into ODS TEXT="your string..."

 

Another option, is to look at using a Jupyter Notebook which helps with this type of format.

 

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

ibaphd
Calcite | Level 5

Hi, thanks for the reply!

 

I'm not using an ODS destination.  I looked at that but it seems too complicated for me!  I also looked at the Jupyter site -- it is definitely over my head!  I may have a Ph.D. but (unfortunately) it is not in any subject closely related to computers.  I'm a fish out of water here.  What I'm hoping to do is to print my results, including a summary, to a file (pdf, I guess -- that's what I know how to do) and put in Dropbox for my coauthors to look over.  I'll probably just have to do it the old fashioned way, but I thought I'd give this a shot first.

 

Thanks again for taking the time to respond! 

Jagadishkatam
Amethyst | Level 16
Please post the complete code you used to generate the output or may be the screenshot . This will help us to provide a better suggestion.
Thanks,
Jag
ibaphd
Calcite | Level 5

Here is it.  Thanks for the help!

 

 

 

libname rvsp 'C:\users\hay\desktop\rules vs principles paper\r vs p justification paper\';
filename rvsp1 'C:\users\hay\desktop\';
options linesize=80;


proc import datafile = 'C:\users\hay\desktop\rules vs principles paper\r vs p justification paper\SASDATASETJUST.xls' out=RVSP.data121416f;

data new; set RVSP.data121416f;

Reeza
Super User

That code just imports data. No analytical results. 

 

You need to be using ODS, it'll save you time in the long run. Or yeah, copy and paste.  

 

 

ODS PDF file='sample.pdf' style = meadow;

 

Title 'PDF Results';

proc REG data=SASHELP.class plots=(diagnostics residuals);

model weight = height age;

run;quit;

 

ods PDF close;

Shmuel
Garnet | Level 18

When you create a report, using:

proc print / proc report / proc tabulate and probably more other procedures

you can add text:

- using title1 to title10 - comming before the report body

- using footnote1 to footnote10 - comming at the end, that is after the report body

 

Titles and footnotes should precede the procedure that creates the report body

And in both you can insert '~n' to break the line into sublines - but that

needs  ODS escapechar = '~n';    to precede the above lines code.

ibaphd
Calcite | Level 5

Hi Shmuel,

 

Thanks so much for the input!

 

I just now responded to the comment before yours and I may have solved the problem in my own "non-SAS" way!

 

Thanks again for the help!

ibaphd
Calcite | Level 5

Okay, I understand now.  I've included it below.

 

I'm just running a simple program with 57 data points.  I use SAS because I analyze the data in several different ways and since I have unequal cell sizes, it's more accurate than SPSS.  I was thinking there might be a statement I was missing -- like "title" or "footnote" --that would allow me to add general text at the end.  Actually, this conversation may have helped me solve my problem in another way. At some point, I mentioned that I plan to save the output as a pdf file. I should be able to add text to the pdf file.  That may well be the easiest way to approach this.

 

Thanks again for your help (even if using the pdf file is the easiest way to go).  Maybe SAS will add a "endnote" statement in the future for something like this.

 

 

 

libname rvsp 'C:\users\hay\desktop\rules vs principles paper\r vs p justification paper\';
filename rvsp1 'C:\users\hay\desktop\';
options linesize=80;


proc import datafile = 'C:\users\hay\desktop\rules vs principles paper\r vs p justification paper\SASDATASETJUST.xls' out=RVSP.data121416f;

data new; set RVSP.data121416f;

 

 

proc sort;
by agreei rp;

 

 

proc glm;
class agreei rp;
model istmts = agreei|rp;
means agreei rp agreei*rp;
title 'Inventory';
title2 '# of Agreement/Disagreement Statements';
title3 'Disagreed (0)/Agreed (1) with Client Treatment';
title4 'Principles (1)/Rules (2) Conditions';
title5 '22101 21215 22205 22116 deleted';

run;
quit;

 

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
  • 8 replies
  • 10533 views
  • 0 likes
  • 4 in conversation