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
Diamond | Level 26

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1856 views
  • 0 likes
  • 3 in conversation