BookmarkSubscribeRSS Feed
jim_snider
Calcite | Level 5
We need to send a comma-delimited file to another party, the recipients are not technically sophisticated. We need the certain numeric data (stored in SAS char variables) to have the leading zeroes preserved and be displayed as text in the CSV file. We're using Excel 2003 and if the number of rows is under the limit I can use proc export to excel and get the desired result. However, the number of rows is usually above the limit and I have not found a workable solution. I'd like to find a solution where SAS will generate the file in the desired format and neither I nor the users will have to spend time converting it to something usable.
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
If you append a leading "'" (single quote mark) to any CSV-formatted cell/column value, Excel automatically treats it as character, as-is, where-is. It's up to you to perform the DATA MANIPULATION using a Data Step technique, with a PUT function in a SAS variable assignment statement.

Scott Barry
SBBWorks, Inc.

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

Discussion stats
  • 1 reply
  • 1175 views
  • 0 likes
  • 2 in conversation