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;
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.
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;
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.
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;
Yes, I saw that. It doesn't seem to work for me. No space is added.
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.
Thank you.
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.
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.