SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Preserving long numeric values in tagsets.excelxp generated spreadsheets

Accepted Solution Solved
Reply
Regular Contributor
Posts: 179
Accepted Solution

Preserving long numeric values in tagsets.excelxp generated spreadsheets

Hi,

Excel has an annoying habit of truncating a long character field when all the bytes in the field are numeric; it thinks it is a numeric value and truncates anything past 16 digits.

I have a 20 byte character key field that at times has an all-numeric key value.  Anyone have a clever way to tell Excel to retain the character interpretation and not try to convert it to a number?

I was able to do this by enclosing the field in double quotes, but would like a cleaner solution if one is available.

Thanks!

--Ben


Accepted Solutions
Solution
‎04-12-2013 03:16 PM
Respected Advisor
Posts: 3,786

Re: Preserving long numeric values in tagsets.excelxp generated spreadsheets

Something like this maybe.  untested.

define longnumber  / display "Header text" style=[tagattr='format:Text'];

View solution in original post


All Replies
Solution
‎04-12-2013 03:16 PM
Respected Advisor
Posts: 3,786

Re: Preserving long numeric values in tagsets.excelxp generated spreadsheets

Something like this maybe.  untested.

define longnumber  / display "Header text" style=[tagattr='format:Text'];

Regular Contributor
Posts: 179

Re: Preserving long numeric values in tagsets.excelxp generated spreadsheets

Will give that a shot.  Thanks!

--Ben

Respected Advisor
Posts: 3,786

Re: Preserving long numeric values in tagsets.excelxp generated spreadsheets

It should work that way but I have also created a style and defined a new style element

      style data_Text   from data      /  just=center tagattr='format:Text';

I think at one time the other way style override did not work but I can't remember.

This was created to display a format like 4. and keep the decimal.  I think it will also work for big numbers.  Hope so.

Message was edited by: data _null_

Regular Contributor
Posts: 179

Re: Preserving long numeric values in tagsets.excelxp generated spreadsheets

Outstanding!  That worked like a charm.  Thanks much!

--Ben

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 478 views
  • 0 likes
  • 2 in conversation