BookmarkSubscribeRSS Feed
RameshReddy
Calcite | Level 5

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.

ANDHRA PRADESHARUNACHAL PRADESHASSAMBIHAR
3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:

  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.

cynthia

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';

run;

   

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';

run;

      

ods _all_ close;

title;

RameshReddy
Calcite | Level 5

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.

Cynthia_sas
SAS Super FREQ

Hi:

  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.

cynthia

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 2847 views
  • 0 likes
  • 2 in conversation