BookmarkSubscribeRSS Feed
deleted_user
Not applicable
how can i put report title in my text output through list data task in EG.
My report title will be coming only in the first page.
I have tried putting in list data report titles but that title is displayed all the pages
as a page header but i want in first page only
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
You did not mention what your destination of interest was. There are not any page numbers or page breaks in ODS HTML, but your SAS title would go before any group break (such as for grouped data) in a List Data task. With ODS RTF your SAS titles go into the header area of the output file, so those titles would appear on every page. With ODS PDF, your SAS titles go onto the top of each page, so that wouldn't work either.

The LIST DATA task is a discreet task, whose purpose is to list your data and the SAS titles for the task will work as described above. What I do when I need a title page is make a separate file or data set with the lines that go on the title page and then within one code block or ODS "sandwich", I have my list data task (or PROC PRINT) preceded by the code that produces the title page.

For example, in the code shown below, the DATA step program creates a table with one variable, TLINE. Every output statement writes one row to the output file, which is WORK.FIRSTPAGE.

The PROC REPORT step, then writes the data set using the NOHEADER option and some special style attributes to turn off the normal table lines that you would otherwise see. You can cut and paste this code into an EG code node and run it. The code will create 3 files for you -- HTML, RTF and PDF.

The PDF and RTF files should print the title lines on the first page at the front of the Proc Print output. The HTML may or may not print the title lines on the first page when you print, depending on the browser/printer that you use.

cynthia

[pre]
ods listing close;
options nodate nonumber;
title; footnote;

ods html file='c:\temp\titlepage.html' style=egdefault;
ods rtf file='c:\temp\titlepage.rtf';
ods pdf file='c:\temp\titlepage.pdf';
data firstpage;
length tline $90;
** write some blank lines at the top;
tline = " ";
output; output; output; output; output;

** then write the "title page lines";
tline ="Jabberwocky";
output;
tline ="by";
output;
tline = "Lewis Carroll";
output;
run;

proc report data=firstpage nowd noheader
style(report)={rules=none frame=void cellspacing=0}
style(column)={just=c font_size=18pt background=white};
column tline;
run;

options number pageno=2;
proc print data=sashelp.class;
run;

ods rtf close;
ods pdf close;
ods html close;
[/pre]

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
  • 1 reply
  • 626 views
  • 0 likes
  • 2 in conversation