BookmarkSubscribeRSS Feed
cperrelli
Calcite | Level 5

Hi,

    I have a database column that is defined as

VARCHAR(21) CHARACTER SET LATIN NOT CASESPECIFIC

When I use ODS and create an xls file the field shows up a scientific numbers in Excel.  If I change the column format manually to number this solves this issue.  The thing is this file is going to be emailed from LINUX without any manual intervention.  What can I do to show the field as numeric in Excel as it seems it's translating the character field.  When I did a proc contents and proc print on the file it's defined as char(21) and the numbers appear correctly.  What do I need to do to make excel recognize this field as either the character that It is defined as or change it to number?  I am not able to attach the list file due to security regulations.

3 REPLIES 3
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

define the column as numeric not varchar 

 

when is SAS think as SAS and leave MS behind. Smiley Happy

Cynthia_sas
Diamond | Level 26

Hi:
ODS does not create an XLS file. It creates an XLSX (ODS EXCEL) or an XML file (ODS TAGSETS.EXCELXP). With the value turned into a number, Excel may still not treat the number correctly.

Typically, which ever one you use, you may have to send a Microsoft format from SAS to Excel.

big_num_xp_xl.png

Cynthia

cperrelli
Calcite | Level 5

Thanks for your reply. I was able to resolve the issue.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1325 views
  • 1 like
  • 3 in conversation