BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cynthia_sas
SAS Super FREQ

Hi:

  TITLE statements are GLOBAL -- that means they stay in effect until they are cancelled or reset. That's why, generally, when I teach how to write TITLE statements in code, I show this:

proc whatever data=mydata;

  title1 'Some Title 1';

  title2 'Some Title 2';

run;

proc whatelse data=mydata;

  title2 'Some Other Title 2';

run;

title; /* resets all titles to nothing or "empty" string */

In the above situation, the second PROC will use TITLE1 as set GLOBALLY by the first TITLE1 statement. and only TITLE2 will change. For ODS PDF, the following code works for me in SAS 9.2, including the change in justification for the ODS TEXT string (I changed the color of each title, so you could see which options control each TITLE statement.

options nodate nonumber;

ods _all_ close;

      

ods pdf file='c:\temp\testtitle.pdf';

ods escapechar='~';

   

proc print data=sashelp.class(obs=3);

  title1 j=c color=purple h=18pt 't1';

  title2 j=r color=red h=18pt 't2';

run;

          

proc means data=sashelp.class min mean max;

  var age;

  title2 j=l color=blue h=18pt 'other t2';

run;

       

ods text= '~S={just=c font_weight=bold font_size=18pt color=cyan}My After Text';

          

ods pdf close;

title;

Do note that the ESCAPECHAR+S= syntax that I used was the original  version of the syntax that should work in 9.1.3 or SAS 9.2....in this syntax, the S must be capitalized and the ESCAPECHAR that you use in the ODS TEXT string must be declared in an ODS ESCAPECHAR statement.

In addition the TITLE (and FOOTNOTE) statements have their own options, (that they inherited from SAS/GRAPH), like j=c or color=purple or h=18pt which allow you to change the TITLE text attributes directly without using STYLE= overrides or ODS ESCAPECHAR syntax or a STYLE template.

cynthia

need_some_help
Calcite | Level 5

Thanks, again. Now it's clear.That's just what I needed)

need_some_help
Calcite | Level 5

And a little question about frame (in which my text appears):

as I read there are 2 ways: to specify frame=void or make bordercolor=white in text style settings

(like:      ods text= "~{style[bordercolor=white frame=void borderwidth=0.3in just=left] My text!}";)

I've also changed User text settings in Style Manager for my style, but there's no effect. Where am I doing wrong?

Cynthia_sas
SAS Super FREQ

Hi:

  Well here's the thing.I would NOT expect those changes to work in an ODS TEXT statement because FRAME (for example) is a TABLE level type of style attribute and although ODS TEXT is enclosed in a TABLE,  by the time the TEXT is written, the HTML TABLE tag has come and gone. But your frame=void and borderwidth of .3 in are incompatible -- BORDERWIDTH is saying you want lines of a certain width and FRAME=VOID is saying that you don't want a frame around the table. And, I'm also confused because when I submit the code that I previously posted, I don't see a FRAME around my TEXT= string (see screen shot). Changing UserText settings in your Style Manager will ONLY change the attributes of the TEXT, it will NOT change the attributes of the "container" that defines that TABLE that the text is in. I think that UserText sits inside the NoteContainer. But since FRAME is already VOID by default around the ODS TEXT string, I'm not sure what you're seeing.

cynthia


no_frame_ods_text.jpg
need_some_help
Calcite | Level 5

Oh, that's the first thing where I'm wrong) - I put wrong string - borderwidth wasn't supposed to be there... as well as one of other parameters should have been commented (whether I try it through 1) frame=void or 2)bordercolor=white). Sorry)

In my StyleManager there are following similar items: Container and Note, Notecontent, Notecontentfixed and for all of them in their attributes (there are four types in the left part of the window, the second one is Frames - if I translate it right) the line style set as None and the color is white (they are all marked as border attributes on this tab). But still there's something round my text......

To make you see the problem from my point of view I attach this (and I just thought - if there's no borders, are they absolutely invisible? no traces?):

my view.png

there's bottom of my table above (where 'lines' are) and under it there is the text from your code (+one empty string), code (red-marked) is original.That's how it looks...

Cynthia_sas
SAS Super FREQ

Ah, the FRAMES style element is different from the FRAME= attribute. For example, many different places in your CSS file will reference the FRAME= attribute (such as SystemTitle or ProcTitle containers), but the FRAMES style element controls regular HTML output where you use the FRAME=, CONTENTS= and/or PAGE= option to make a standard HTML frame navigation environment. This style element would or should have NO impact on PDF output and if you are changing it in the Style Manager, I doubt that it is having an impact on your PDF output.

  I am baffled by the border FRAME that appears around your TEXT output. I expect a FRAME around the LINES strings, because they appear within the boundary of the report table, so if the report table has a FRAME or box around it, the LINES strings will appear within the box of the table. The ODS TEXT output, as you can see from my screen shot, in "vanilla" mode -- does NOT have any box or frame around my ODS TEXT string. Therefore, I can only assume that something in your CSS file is being changed incorrectly.

  I would recommend that you have someone look at all your code, including the CSS file created by the Style Manager to see what's going on. The folks best equipped to look at ALL your code and ALL your CSS and at your particular configuration are the folks in Tech Support. So I would recommend that you open a track with Tech Support on this matter.

cynthia

need_some_help
Calcite | Level 5

I haven't thought about that difference between Frames style element and the Frame attribute... But I tried my report in a new project where specified Minimal style for PDF-result (in Options menu) and in additional ODS PDF parameters I specified style=plateau (that was the parent style for my own one which I specified earlier) - so there would be no my incorrect changes (but plateau style is not in PDF-styles list, it's in Style Manager list - does it matter?), but unfortunately I still have the same result( So, I finally opened a track with Tech Support, hope there's nothing serious) Thanks a lot for your help - now I will pay attention for all that details!

need_some_help
Calcite | Level 5

I'm trying to understand how the sorting goes and there is something dimly for me:

I wrote special example:

data one;
input region $ name $ item;
datalines;
m d 15
m d 0
m a 10
m b 20
k l 20
k c 25
n h 15
n h 30
;
run;

proc sql;
create table info as
select region,name,item,sum(item) as item_sum
from work.one
group by region,name;
quit;

ods html ;
title 'What is wrong?';
proc report data=info nowd;
column region name item item_sum;
define region / group order=formatted;
define name / group;
define item_sum /group order=internal;
define item / analysis sum;
rbreak after /summarize;
run;
ods html close;

as I thought results should be sorted first by region and then by item_sum (that's the aim) but instead of that they are sorted by region and name (though no order specified for name). Why is that?


Cynthia_sas
SAS Super FREQ

Hi:

  A couple of suggestions....I almost didn't see this posting. It might be better, if you are switching to a new topic, to start a new thread, instead of adding to the old thread. Your new question is a PROC REPORT question and your previous question was about style and style templates and PDF. This new question is all about PROC REPORT and really is unrelated to your previous question. So that's the first suggestion.

  The second suggestion is that you might benefit from looking at the PROC REPORT documentation topics entitled, "Concepts: REPORT Procedure" and "How Proc Report Builds A Report":

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146851.htm

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473631.htm

In the Concepts topic, you will find this description of the behavior for GROUP usage variables:

"If the report contains multiple group variables, then the REPORT procedure establishes the order of the detail rows by sorting these variables from left to right in the report." So, you may wonder what that means ... "from left to right" ...  it means the left to right order as the variables are listed on the COLUMN statement. PROC REPORT is behaving as documented. The results you observe are directly related to the order in which the items are listed on your COLUMN statement. Even if you have done a prior sort, the REPORT procedure will reorder, as needed, based on how you code the COLUMN statement order from left to right.

cynthia

need_some_help
Calcite | Level 5

That's really too much stuff for one topic, sorry) and thanks for useful references)

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 24 replies
  • 3258 views
  • 13 likes
  • 2 in conversation