BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
wcp_fnfg
Obsidian | Level 7

I can use data _null_ and file print, but not matter what, when it shows up in excel, it has a period in front of the text.  Any alternatives\fixes?

data _null_;

file print;

put 'Hi Wes';

run;

Ends up as

.Hi Wes  

(The period is not present in the output window, just excel.

EG5.1

1 ACCEPTED SOLUTION

Accepted Solutions
Chevell_sas
SAS Employee

To prevent this behavior, you can use the tagset option Ascii_dots="no". The default of this option is yes.

View solution in original post

3 REPLIES 3
Chevell_sas
SAS Employee

To prevent this behavior, you can use the tagset option Ascii_dots="no". The default of this option is yes.

wcp_fnfg
Obsidian | Level 7

Yup that works.

Any idea how to style that text, like bold, italics, weight, etc?     

Cynthia_sas
SAS Super FREQ

Hi:

  You can use ODS ESCAPECHAR functions with STYLE overrides to alter the text. You could look at changing the style template. I don't remember off the top of my head which style element you would change. The Data element, I think. Or you could use a PROC REPORT approach. See the code below.
      

Cynthia

ods tagsets.excelxp file='c:\temp\data_null_xp1.xml'
    style=htmlblue options(ascii_dots='no');
ods escapechar='^';
**Method 1;
data _null_;
file print;
put '^{style[font_weight=bold font_size=12pt color=purple]Hello World}';
put 'Twas Brillig and the slithy toves';
run;
  
ods tagsets.excelxp close;
  

data world;
  length text $50;
  text = 'Hello World';
  output;
  text='Twas Brillig and the slithy toves';
  output;
run;
    
ods tagsets.excelxp file='c:\temp\proc_report2.xml'
    style=htmlblue ;
   
**Method 2;
proc report data=world nowd noheader
  style(column)={font_weight=bold font_size=12pt color=purple};
  column text;
run;

ods tagsets.excelxp close;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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