- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Does anyone know how to output 'equal to' sign to excel file using ODS tagsets.
compute equalsign2 / character length=2;
equalsign2 = "=";
endcomp;
This does not work because it considers it to be a formula
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How about this :
ods tagsets.excelxp file='c:\temp\xyz.xml';
proc report data=sashelp.class nowd;
column name age equalsign ;
define name/display;
define age/display;
define equalsign /computed;
compute equalsign / character length=4 ;
equalsign = '09'x||'=';
endcomp;
run;
ods tagsets.excelxp close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Have you tried this?
equalsign2 = "'=";
(I'm only guessing. I don't have Excel installed on my SAS workstation.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
yes i have. but then when i open the excel file it appears as '=
the sign quote disapears only when you go to that cell and move out of it
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
What will be the purpose of the equals sign in the Excel cell, if not the beginning of a formula?
My Excel 2013 accepts a (manually entered) single equals sign without any problem. Therefore, I assume that in your case there will be some text to the right of the equals sign (a combination which would indeed be interpreted as a formula). Is this true?
An expression like " =abc" (without quotation marks, but with a leading blank) does not seem to be interpreted as a formula. Would this be an option?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The purpose of puting the equal to sign is to display 2 + 2 = 4
I need to display this statement as it is.
2
+
2
=
4
they all are in different cells and there is no text after the equal as you see in the example given
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the clarification. What exactly is the issue (e.g. error message) when you put the single equals sign into a cell?
If the " =" (equals sign preceded by a space) is not acceptable for you, we could try a variety of other ASCII characters (from the code range 0, ..., 31) as replacements for the space (ASCII 32). I've just written all of these together with an equals sign into individual cells of an Excel sheet and several of them seem to be totally invisible (i.e. do not even appear as a blank space to the left of the equals sign, neither in Excel, nor in Notepad). ASCII 31 (hex 1F) is one of these. So, maybe this would be a candidate:
equalsign2 = '1F3D'x;
('3D'x is the equals sign in hexadecimal notation.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your support.
Below is the message output to a log file. I'm using SAS University Edition.
Actually it is considering the equal sign as the beginning of a formula.
compute equalsign / character length=4 ;
equalsign = '3D'x;
endcomp;
XML Spreadsheet Warning in Table
REASON: Bad Value
FILE: C:\Myfile.xls
GROUP: Row
TAG: Cell
ATTRIB: Formula
VALUE: =
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I see. Have you tried '1F3D'x (or '1E3D'x or '1D3D'x or ...)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
YES JUST TRIED THANKS.
USING THESE 3, IT DISPLAYED
?=
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
going to bed now, will catch ya tomorrow
thanks a million.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How about this :
ods tagsets.excelxp file='c:\temp\xyz.xml';
proc report data=sashelp.class nowd;
column name age equalsign ;
define name/display;
define age/display;
define equalsign /computed;
compute equalsign / character length=4 ;
equalsign = '09'x||'=';
endcomp;
run;
ods tagsets.excelxp close;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That worked beautifully
Thanks a lot.