The SAS Output Delivery System and reporting techniques

tagsets.excelxp: special characters to create indentation?

Accepted Solution Solved
Reply
Regular Contributor
Posts: 194
Accepted Solution

tagsets.excelxp: special characters to create indentation?

I'm using ods tagsets.excelxp to output my results.
Are there any special characters I can add in front of "-Lost-Time" so that "-Lost-Time" appears indented (3-5 spaces is fine) when I output in Excel using proc report?

proc format;
value $oshaf "a_reg"="Reg"
      "b_lost"="-Lost-Time"
      "c_darb"="DARB"
;
run;


Accepted Solutions
Solution
‎05-20-2014 10:33 PM
SAS Super FREQ
Posts: 8,645

Re: tagsets.excelxp: special characters to create indentation?

Hi:

  I tried the HTML named entity for non-breaking space with Chevell's code -- just changed the format to:

proc format;
value $oshaf    "a_reg"="Reg"
                "b_lost"='   -Lost-Time'
                "c_darb"="DARB" ;
run;

Where I used the following: & nbsp ; (ampersand-nbsp-semi-colon) without ANY spaces. I am writing it this way so you can see what needs to be typed. I am also attaching a pix of the syntax and a shot of the output. Since this posting mechanism uses HTML, it may "eat" the non-breaking space entity.


Cynthia

Drat! the post ate my ampersand-nbsp; -- without any spaces -- look at the screen shot.

View solution in original post

Attachment

All Replies
SAS Employee
Posts: 87

Re: tagsets.excelxp: special characters to create indentation?

You can use the non breaking space characters to add the space and then use the PROTECTSPACIALCHARS= attribute so that they are not protected.

proc format;
value $oshaf    "a_reg"="Reg"
                        "b_lost"='   -Lost-Time'
                         "c_darb"="DARB" ;
run;

data one;
length a $10.;
  a="a_reg";
  output;
  a="b_lost";
  output;
  a= "c_darb";
  output;
run;

ods tagsets.ExcelXP file="c:\temp.xlml";

proc print style(data)={protectspecialchars=off};
format a $oshaf.;
run;

ods tagsets.ExcelXp close;

Regular Contributor
Posts: 194

Re: tagsets.excelxp: special characters to create indentation?

Thank you for the protectspecialchars suggestion. However, I'm not sure what is the character(s) needed to create space(s) in Excel? Thank you.

Grand Advisor
Posts: 16,378

Re: tagsets.excelxp: special characters to create indentation?

Notice that in Chevell's code he's manually added spaces in his proc format.

proc format;

value $oshaf    "a_reg"="Reg"

                        "b_lost"='   -Lost-Time'

                         "c_darb"="DARB" ;

run;

Regular Contributor
Posts: 194

Re: tagsets.excelxp: special characters to create indentation?

Yes, I saw that. It doesn't seem to work for me. No space is added.

Grand Advisor
Posts: 16,378

Re: tagsets.excelxp: special characters to create indentation?

ALT+255?

I can't test it right now Smiley Sad

http://www2.sas.com/proceedings/sugi31/055-31.pdf

Solution
‎05-20-2014 10:33 PM
SAS Super FREQ
Posts: 8,645

Re: tagsets.excelxp: special characters to create indentation?

Hi:

  I tried the HTML named entity for non-breaking space with Chevell's code -- just changed the format to:

proc format;
value $oshaf    "a_reg"="Reg"
                "b_lost"='   -Lost-Time'
                "c_darb"="DARB" ;
run;

Where I used the following: & nbsp ; (ampersand-nbsp-semi-colon) without ANY spaces. I am writing it this way so you can see what needs to be typed. I am also attaching a pix of the syntax and a shot of the output. Since this posting mechanism uses HTML, it may "eat" the non-breaking space entity.


Cynthia

Drat! the post ate my ampersand-nbsp; -- without any spaces -- look at the screen shot.

Attachment
Regular Contributor
Posts: 194

Re: tagsets.excelxp: special characters to create indentation?

Thank you.

Post a Question
Discussion Stats
  • 7 replies
  • 789 views
  • 3 likes
  • 4 in conversation