Posts

Showing posts with the label ODS escapechar

SAS Instructor Tips: Programming

Image
SAS Instructor Tip: Programming Featured Instructor: Cynthia Johnson How do I combine my SAS data sets and eliminate duplicate rows at the same time? SAS Instructor Cynthia Johnson responds ... SAS Instructor Tip: Programming Featured Instructor: Kent Reeve What happens when you forget the period on an informat when using formatted input? SAS Programming Tips[1] SAS/GRAPH Tip: Controlling the Graph Axis SAS Instructor Cynthia Zender shows you how to control the graph axis through a feature of using the AXIS statement. SAS ODS Tip: Creating Page X of Y Page Numbers SAS Instructor Cynthia Zender shows you how to use the SAS ODS ESCAPECHAR to create a "Page X of Y Page Numbers" SAS ODS Tip: Creating a Table of Contents SAS Instructor Cynthia Zender shows you how to create a table of contents using the CONTENTS= Option with ODS RTF and ODS PDF destinations. SAS ODS Tip: Controlling the Width of Cells SAS Instructor Cynthia Zender sh...

Subscript or Superscript in the footers/titles of RTF output

Image
Wondering how to create a subscripts and superscipt in title or footnotes of the rtf output... here is a way to do it.... Execute the following program to get an Idea about how to keep SUBSCRIPTS and SUPERSCRIPTS in footnotes and titles of rtf output.. ************************************************************; data test ; length secnam $15; input sortord secnam $ pvalue; cards; 1 demog 0.8812 2 ae 0.7112 3 disposition 0.8112 4 medicalhistory 0.9112 ; run; ods listing close; ods rtf file = "Test output.rtf" style= rtfout ; ods escapechar = '\' ; proc report data = test missing split= "$" spacing=0 headline nowd; column sortord secnam pvalue ; define sortord / order noprint; define secnam / order flow "Demographics$Variable\{super a}" ; define pvalue / display flow "ANOVA$P-Value\{sub p}" ; run; ods rtf close; ods trace off; ods listing; *************************************************************; Variable\{super a}"; *Adds a...

How to customize page numbers in RTF output

Usage Note 24439: In SAS 9.1, are there easier ways to customize page numbers in RTF output? direct link here http://support.sas.com/kb/24/439.html Yes, beginning with SAS 9.1, page numbers can be customized in the RTF destination by using an escape character and the {thispage} function, {lastpage} function, {pageof} function, or all three: ods escapechar=' ^ '; ods listing close; ods rtf file=' c:\tests\test.rtf '; data test ; do i= 1 to 50 ; output; end; run ; proc print data=test noobs; title ' Page ^{thispage} of ^{lastpage} '; footnote ' ^{pageof} '; run ; ods listing; ods rtf close;

How to create a comma separated file (.csv) of a SAS dataset?

IN SAS programming, we often require outputting the dataset in different formats like EXCEL and CSV etc and here are the five different ways to export the SAS dataset into .csv file. Example: data new ; infile datalines dsd dlm=' ' missover; input a b c d; datalines; 3 5 1 1 4 1 . . 5 8 3 2 6 0 4 4 ; run ; By putting MISSOVER in the infile statement we are telling SAS to do not look for the data in the next lane if it runs out of the data, instead keep missing values for any remaining variables. DSD and DLM options should be included always in the infile statement, if we include the dlm=’ ‘ in the infile statement then SAS will put one digit for each variable even though we haven’t assigned any length to variable. DSD option will tell SAS to consider a missing value if 2 delimiters are present side by side in any observation. When we ran the above program in SAS, we create a SAS dataset name ‘ NEW’ in the work directory and if we want to create a ...