BookmarkSubscribeRSS Feed
Jaheuk
Obsidian | Level 7

dear all,

does someone has the correct syntax in using STYLE attributes when programming in DATA _NULL_  ?

 

a piece I already have 😉

 

ODS LISTING CLOSE;                        
ODS PDF NOTOC FILE=mypdf STYLE=sasweb  ;  
ods escapechar='^';                        
                                           
data _NULL_ ;                              
 SET verder  END=LAST;                     
 file PRINT ;                           
put @01 "^S={foreground=red textdecoration=underline}"     @01 "^S={foreground=red textdecoration=underline}"    
        haorgcd           5. '/'                          
        volg              2. "^S={}";                     
put @01 taal         $LA.                                  @01 taal         $LA.                                 
        crtn_dttm    $26.;                                
put @01 taal         $LB.                                  @01 taal         $LB.                                 
        tran_amt     commax17.2 ' '  ;
run;

 

I want to color, bold, . . .  some text        

2 REPLIES 2
ballardw
Super User

FILE Print does not honor any style options, it wants to create plain text.

FILE Print ODS may but you will have to provde a template for the table produced. The online documentation example for File Print ODS shows an example of creating a template with minimal style elements and then linking the data to the template.

The definition could look something like:

proc template;
define table phonelist;
      column name phone;
      dynamic colheader;
   define name;
      generic=on;
      header=colheader;

      style=data{fontstyle=italic fontsize=5};
   end;

   define phone;
      header='Telephone';
      style=datafixed;
   end;
end;
run;

You attach style elements to the variable as in the template above.

 

Then in the Data _null_ you reference the template and link variables to the definitions.

It may be easier to use PROC Print and style overrides.

Cynthia_sas
SAS Super FREQ
Hi:
To really take full advantage of style overrides with DATA _NULL_ you need to move to the Report Writing Interface, as shown in this paper in the RWI examples:
http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf (starting on page 16)

cynthia

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!

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