Hi, I have a report created from proc report and would like to rename the lowest level nodes. Please see the example coding below: title; footnote; options nodate nonumber center; ods listing close; ods document name=work.TOCtest(write); ods escapechar='^'; ods pdf file="c:\temp\test.pdf" style=minimal; ODS PROCLABEL "PRD Sale Report"; proc sort data=sashelp.prdsale out=prdsale; by Country; run; data report; set prdsale nobs=last; by country; country=compress(country,'.'); length sitestr $1000; retain sitestr ' '; if first.country then if sitestr=' ' then sitestr=compress(country); else sitestr=trim(sitestr)||' '||compress(country); if last then do; call symput('lastpage',compress(country)); call symput('sitestr',trim(sitestr)); end; run; %let sitett=%sysfunc(countw("&sitestr",' ')); %put lastpage=&lastpage sitestr=&sitestr sitett=&sitett; proc REPORT data=REPORT nowindows headline contents="Form Level - details" style(report)=[frame=void rules=none cellspacing=0 padding=3pt] style(header)=[bordertopcolor=black bordertopwidth=1 borderbottomcolor=black borderbottomwidth=1 background=_udef_ font=(Arial, 8pt) textalign=l ] style(column)=[font=(Arial, 8pt)]; *by country; column country REGION DIVISION PRODTYPE PRODUCT QUARTER YEAR MONTH ACTUAL; define country /group ; define REGION /group ; define QUARTER /ORDER ; define YEAR/ORDER ; define MONTH/display; define ACTUAL /sum format=dollar16.2; break after REGION/summarize skip; compute after REGION/style={bordertopcolor=black bordertopwidth=1}; line ' ' ; endcomp; compute after country; if country="&lastpage" then myval='x'; endcomp; break after country / summarize page; compute after _page_/ style={bordertopcolor=black bordertopwidth=1}; length text $100; if myval='x' then text='^S={font_face=arial font_size=1pt}'; else text='^S={just=r font_face=arial font_size=8pt} (Continued)'; line text $100.; endcomp; rbreak after / summarize; compute after / style={font_size=10pt}; line "total "; endcomp; run; ods document close; ods pdf close; proc document name=work.TOCtest; list / levels=all; run; quit; ods listing; %macro test; proc document name=work.tocnew(write); make \testpath; dir \testpath#1; setlabel \testpath#1 "testing-Form Level"; copy \Report#1\Report#1\Report#1 to ^; %do i=1 %to &sitett; %let site=%scan(&sitestr,&i); %put site=&site; setlabel \Report#1\Report#1\Report#1\Report#&i. "Country=&site."; %end; run; quit; %mend; %test; ods pdf file='c:\temp\replay_new.pdf'; proc document name=work.tocnew; replay; run; quit; ods _all_ close; Right now the TOC has the lowest nodes: 'Table 1','Table 2','Table 3' and 'Table 4'. What I would like to be are: 'Canada','Germany','USA' and 'Total'. I thought I can use PROC document 'setlabel ' to rename it (see the above codes), but it gives the error: ERROR: Invalid document path: \Work.Tocnew\Report#1\Report#1\Report#1. Also another 2 questions: 1 how to repeat group/order value on the first line of next page? and 2: how to add a line at the end of each page when the table continuing to next page? Anyone can help me with this? Thanks in advance! Helen
... View more