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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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