Desktop productivity for business analysts and programmers

report headers in vertical

Posts: 31

report headers in vertical

Hi evrey one,

how can i show headers in vertical in the proc report ..this i want use in ODS PDF.

how can i change Headers to a vertical format in proc report...

any one have idea,

thanks in advance,

for your reference i appended excel Sheet.

Posts: 8,820

Re: report headers in vertical


  This is one of those instances where PROC PRINT has an option that makes vertical headers easier to do than PROC REPORT. PROC PRINT has the HEADING=V option, used on the PROC PRINT statement, as shown in the code below.

  For PROC REPORT, you have to insert a "new line" or "line feed" or "carriage return" into your column header label (between each letter) using ODS ESCAPECHAR and the newline feature. The form of syntax that you use will be different whether you have SAS 9.1.3 or SAS 9.2 or 9.3 -- so my code for PROC REPORT shows both forms of invocation. If you have SAS 9.2 or higher, then both forms of the syntax should work. If you only have SAS 9.1.3, then the labels for AGE and SEX will look funny in the PROC REPORT output. The comment in the code explains the two different syntax methods. If you do not need any of the other features of PROC REPORT (such as the compute block or the summarizing features or the LINE statement), then you may want to use PROC PRINT.

  I do not believe there is a way in PDF to rotate the font characters sideways, as you show. You'd have to verify this by checking with Tech Support.


ods _all_ close;


ods pdf file='c:\temp\vertheaders.pdf'

    bookmarkgen=yes bookmarklist=hide;


ods escapechar='^';


/* ********************************************************************

   If you are using SAS 9.1.3, then the syntax ESCAPECHAR+n will insert

   a "new line" or "line feed" into a text string. If you are using

   SAS 9.2 or 9.3, then the syntax ESCAPECHAR+{newline 1} will insert

   the "new line" into the string.

   With PROC PRINT, you only need to specify HEADING=V to achieve,

   the same result.

   SAS 9.1.3: if ESCAPECHAR=^  then use ^n

   SAS 9.2 or 9.3: if ESCAPECHAR=^  then use either ^n  or ^{newline 1}




proc report data=sashelp.class(obs=2) nowd;

  column name age sex height weight;

  title 'REPORT: Vertical Headers in PDF using ESCAPECHAR';

  define name / display 'N^na^nm^ne';

  define age / display 'A^{newline 1}g^{newline 1}e';

  define sex / display 'G^{newline 1}e^{newline 1}n^{newline 1}d^{newline 1}e^{newline 1}r';

  define height / display 'H^ne^ni^ng^nh^nt';

  define weight / display 'W^ne^ni^ng^nh^nt';



proc print data=sashelp.class(obs=2) noobs label heading=v;

  title 'PRINT: Vertical Option with PRINT in PDF';

  var name age sex height weight;

  label name = 'Name'

        age = 'Age'

        sex = 'Gender'

        height = 'Height'

        weight = 'Weight';



ods _all_ close;


Posts: 31

report headers in vertical

Thank you very much Synthia ,but still headers are not comimg which i require in vertical format .that means it should come cahracters also require in 90 degree format.that i have already appended in Excel Sheet.

Posts: 8,820

report headers in vertical


  PDF is not Excel -- I'm not sure that PDF has a way to rotate the individual letters in a header in the way you require. I believe that you will have to work with Tech Support to verify this fact, especially if your requirement to create rotated, vertical headers is confined to PDF only.

  If you want Excel output, then I believe that you can rotate the headers using Excel commands and controls using TAGSETS.EXCELXP. Tech Support can help you there, too.


Ask a Question
Discussion stats
  • 3 replies
  • 2 in conversation