BookmarkSubscribeRSS Feed
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7

HI ,

Here is a sample codiing.

I have two line statements.

what I need is the first line statment to be different font size from the below line statment  and the font to be bold'

Is it possible to have differnet line statments to be different font attributes?

thanks very much for your help in advance

ods listing close;
ods pdf file ='c:\temp\test.pdf';

 

proc report data=sashelp.class nowd;

  column age name height weight;

  define age / order;


  compute after _page_/

    style={font_size=14pt font_face=Arial foreground=cyan

           font_weight=bold just=l};

    line ' I want this line font size and need to bold';
    line ' I want this line with different font size and non bold font';

  endcomp;

run;

ods _all_ close;

Thanks

regards

Tony.

4 REPLIES 4
BrunoMueller
SAS Super FREQ

Have a look at the Inline formatting supported by ODS, SAS(R) 9.4 Output Delivery System: User's Guide, Third Edition

Here is some sample code

ods escapechar='^';
proc report data=sashelp.class nowd;
 
column age name height weight;
  define age / order;

 
compute after _page_/

   
style={

     just=l};
    length line1 line2 $ 256;
    line1 =
'^{style [font_weight=bold]I want this line font size and need to bold}';
    len1 = length(line1);
   
line line1 $varying256. len1;
    line2 = '^{style [font_size=14pt foreground=cyan]I want this line with different font size and non bold font}';
    len2 = length(line2);
   
line line2 $varying256. len2;

 
endcomp;
run;
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7

Hi Bruno

Thanks very much for getting back so soon, I really appreciate  but I couldn't get what I  expect. 

I am runnng SAS 8.2.

When I run this code, I get the folloiwng output for Line statment.

                                                                  ^{style [font_weight=bold]I want this line font size and need to bold}
                                                   ^{style [font_size=14pt foreground=cyan]I want this line with different font size and non bold font}

Thanks

BrunoMueller
SAS Super FREQ

Well I do not remember whether the Inline formatting was already available with SAS8.2 you might find some user group papers talking about this subject.

Have a look here SAS Technical Support Services and Policies you are using a really old version it would make sense to go for a newer version.

Cynthia_sas
SAS Super FREQ

Hi,

  ODS ESCAPECHAR was available in late version 8, but the syntax was different. Instead of what Bruno used in his code with a "function-like" style override using ODS ESCAPECHAR and in-line formatting, the original syntax was a bit different. For one thing, it wasn't like a function call and for another, you couldn't nest style overrides. But I have many examples of the original style ODS ESCAPECHAR in this 2007 Global Forum paper on ESCAPECHAR: http://www2.sas.com/proceedings/forum2007/099-2007.pdf, which has comparisons to the "new" syntax. So you can work backwards from the new to the original syntax.

cynthia

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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