turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- ODS OUTPUT 'EQUAL TO' CHARACTER TO EXCEL

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 01:54 PM

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

Solution

03-06-2016
01:40 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 08:15 PM

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;
```

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 02:03 PM

Have you tried this?

`equalsign2 = "'=";`

(I'm only guessing. I don't have Excel installed on my SAS workstation.)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 02:11 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 03:51 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 04:02 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 04:25 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 05:28 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 05:39 PM

Ok, I see. Have you tried '1F3D'x (or '1E3D'x or '1D3D'x or ...)?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 05:51 PM

YES JUST TRIED THANKS.

USING THESE 3, IT DISPLAYED

?=

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 05:55 PM

going to bed now, will catch ya tomorrow

thanks a million.

Solution

03-06-2016
01:40 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2016 08:15 PM

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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-06-2016 01:40 PM

That worked beautifully

Thanks a lot.