<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to replace . in label with # for Excel output? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98864#M20838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drat!&amp;nbsp; I just tried DBMS=xls as you suggested, and had two problems.&amp;nbsp; The first problem is that a format I generated wasn't found.&amp;nbsp; Inconvenient, but not that much of a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the second problem is a deal-breaker.&amp;nbsp; Apparently, DBMS=XLS is restricted to a maximum of 65,536 lines of data, and almost everything I export is going to be larger (usually much larger).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the idea!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Apr 2012 17:17:49 GMT</pubDate>
    <dc:creator>WendyT</dc:creator>
    <dc:date>2012-04-30T17:17:49Z</dc:date>
    <item>
      <title>how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98862#M20836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; SAS experts-&amp;nbsp; I'm asking for your help again...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to use PROC EXPORT to send SAS datasets to Excel, but Excel will not accept a variable label that contains a dot.&amp;nbsp; Instead, Excel wants the label to have # to produce a dot (log file below).&amp;nbsp; &lt;A href="http://support.sas.com/kb/16/842.html"&gt;http://support.sas.com/kb/16/842.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I am eliminating the dot on the way in from Oracle, but will have to solve this soon. My folks can deal with "E. Coli" not having a dot, but "Grain Size % in 2.76-3.91 um" requires it to make sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't want the # in my SAS labels, and am using the split255 macro for output. &lt;A href="http://support.sas.com/kb/36/904.html"&gt;http://support.sas.com/kb/36/904.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been messing with PROC DATASETS and trying to use the TRANSLATE function, but so far have been only able either to delete the labels, or make them "translate('label', '#', '.')"&amp;nbsp; (oops!)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy T&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; DATA TEST_DOT ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT NODOT ONEDOT TWODOT SEPDOT ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; LABEL NODOT='No Dot' ONEDOT='One.Dot' TWODOT='Two..Dots' SEPDOT='Sep.arated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;3&amp;nbsp; !&amp;nbsp; . Dots' ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp; DATALINES ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: The data set WORK.TEST_DOT has 1 observations and 4 variables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; system cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 247k&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OS Memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5232k&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4/30/2012&amp;nbsp; 11:12:09 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp; RUN ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp; PROC EXPORT DATA=WORK.TEST_DOT OUTFILE="&amp;amp;data_req\tester.xlsx"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;9&amp;nbsp; ! DBMS=EXCEL2007 REPLACE LABEL ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;10&amp;nbsp;&amp;nbsp; RUN ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; color: #ff0000; font-size: 8pt;"&gt;&lt;STRONG&gt;ERROR: Bind parameters: Invalid column name: One.Dot&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;WARNING: File deletion failed for _IMEX_.TEST_DOT.DATA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;ERROR: Export unsuccessful.&amp;nbsp; See SAS Log for details.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: PROCEDURE EXPORT used (Total process time):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.24 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; system cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.18 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 527k&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OS Memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5744k&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4/30/2012&amp;nbsp; 11:12:10 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;11&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;13&amp;nbsp;&amp;nbsp; DATA TEST_POUND ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;14&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUT NODOT ONEDOT TWODOT SEPDOT ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LABEL NODOT='No Dot' ONEDOT='One#Dot' TWODOT='Two##Dots'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;15 ! SEPDOT='Sep#arated # Dots' ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATALINES ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: The data set WORK.TEST_POUND has 1 observations and 4 variables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; system cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 189k&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OS Memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5744k&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4/30/2012&amp;nbsp; 11:12:10 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;18&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;19&amp;nbsp;&amp;nbsp; RUN ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;20&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;21&amp;nbsp;&amp;nbsp; PROC EXPORT DATA=WORK.TEST_POUND OUTFILE="&amp;amp;data_req\tester.xlsx"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;21 ! DBMS=EXCEL2007 REPLACE LABEL ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;22&amp;nbsp;&amp;nbsp; RUN ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: "TEST_POUND" range/sheet was successfully created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: PROCEDURE EXPORT used (Total process time):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.99 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; system cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 479k&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OS Memory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5744k&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timestamp&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4/30/2012&amp;nbsp; 11:12:11 AM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 16:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98862#M20836</guid>
      <dc:creator>WendyT</dc:creator>
      <dc:date>2012-04-30T16:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98863#M20837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wendy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can get away with exporting an xls rather than an xlsx file, you could just use the xls engine instead.&amp;nbsp; The following seems to accomplish exactly what you are looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA=WORK.TEST_DOT OUTFILE="&amp;amp;data_req\tester.xls"&lt;/P&gt;&lt;P&gt;DBMS=xls REPLACE LABEL ;&lt;/P&gt;&lt;P&gt;RUN ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 16:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98863#M20837</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-04-30T16:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98864#M20838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drat!&amp;nbsp; I just tried DBMS=xls as you suggested, and had two problems.&amp;nbsp; The first problem is that a format I generated wasn't found.&amp;nbsp; Inconvenient, but not that much of a problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the second problem is a deal-breaker.&amp;nbsp; Apparently, DBMS=XLS is restricted to a maximum of 65,536 lines of data, and almost everything I export is going to be larger (usually much larger).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the idea!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 17:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98864#M20838</guid>
      <dc:creator>WendyT</dc:creator>
      <dc:date>2012-04-30T17:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98865#M20839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem seems to occur after the table headings are created in Excel. The following, where I create an empty table and then insert into it, worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;INPUT NODOT ONEDOT TWODOT SEPDOT ;&lt;BR /&gt;LABEL NODOT='No Dot' ONEDOT='One.Dot' TWODOT='Two..Dots' SEPDOT='Sep.arated.Dots' ;&lt;BR /&gt;DATALINES ;&lt;BR /&gt;1 2 3 4&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname xl Excel "&amp;amp;sasforum.\Datasets\DotTest.xlsx" version=2007 scan_text=no;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql dquote=ansi;&lt;BR /&gt;drop table xl.dotSet;&lt;BR /&gt;select catx(' ', name, 'as', quote(trim(label))) into :renames separated by ',' &lt;BR /&gt;from dictionary.columns where libname='WORK' and memname='TEST';&lt;BR /&gt;create table xl.dotSet as &lt;BR /&gt;select &amp;amp;renames. from test where 0; /* creates an empty table */&lt;BR /&gt;insert into xl.dotSet select * from test;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname xl clear;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 19:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98865#M20839</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-04-30T19:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98866#M20840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PGStats-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to run your code successfully for one dataset, but so far have been unable to get it to run inside the %split255 macro. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My connection just cut off for some reason, so I will have another try tomorrow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the idea!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2012 21:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98866#M20840</guid>
      <dc:creator>WendyT</dc:creator>
      <dc:date>2012-04-30T21:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98867#M20841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wendy, revisiting this problem, I realized that the tranlation of dots into pound characters is not only a workaround, but a &lt;EM&gt;feature&lt;/EM&gt; of the import procedure. When you export column names containing pound characters to Excel, they appear as dots in Excel and when you import columns names containing dots from Excel they are translated to pound characters in the variable labels. Therefore, I think the best thing to do when you want to export columns names with dots, is to translate the names beforehand. This is what the following macro does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro saveXlsx(dsn,xlsxFile,lib=WORK); &lt;BR /&gt;libname _xl Excel "&amp;amp;xlsxFile." version=2007;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;drop table _xl.&amp;amp;dsn.;&lt;BR /&gt;select catx(" ", name, "as", quote(translate(trim(label),"#","."))) &lt;BR /&gt;into :renames separated by "," &lt;BR /&gt;from dictionary.columns &lt;BR /&gt;where libname=upcase("&amp;amp;lib.") and memname=upcase("&amp;amp;dsn.");&lt;BR /&gt;proc sql dquote=ansi;&lt;BR /&gt;create table _xl.&amp;amp;dsn. as &lt;BR /&gt;select &amp;amp;renames. from &amp;amp;lib..&amp;amp;dsn.;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;libname _xl clear;&lt;BR /&gt;%mend saveXlsx;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2012 15:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98867#M20841</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-05-01T15:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98868#M20842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PGStats-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for the macro!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, I have not explained my problem very well...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have SAS datasets with labels (not variable names) that contain dots, and I need to output the SAS tables to Excel using the labels as headers (not the variable names).&amp;nbsp; I am using an adaptation of the %split255 macro to send the SAS datasets to Excel, as quite a few of the SAS datasets have more than 255 columns.&amp;nbsp; The %split255 macro uses PROC EXPORT, and so far, I have been unable to adapt that section of the macro to use the proc sql solution you suggested yesterday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A little illustration may help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataset PERM.DATASET&lt;/P&gt;&lt;P&gt;Labels:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Station Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date of Collection&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E. Coli&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Secchi-in.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Variables:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASDATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using PROC EXPORT, I can choose either the name or label for the header row (and the names are not a viable option).&amp;nbsp; This is where I run into the 'feature' where Excel wants # in order to display . in the header row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, to get&amp;nbsp;&amp;nbsp;&amp;nbsp; Station Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date and Time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;E. Coli&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Secchi-in.&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; as the header row in Excel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS labels need to be&amp;nbsp; Station Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date and Time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;E# Coli&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Secchi-in#&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I don't want my SAS labels to actually have # in PERM.DATASET1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to get to&lt;/P&gt;&lt;P&gt;WORK.DATASET1 with&lt;/P&gt;&lt;P&gt;Labels:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Station Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date and Time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; E# Coli&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Secchi-in#&amp;nbsp; &lt;/P&gt;&lt;P&gt;Variables:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STA&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASDATE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SEC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I can use PROC EXPORT with LABEL in the %split255 macro to output any dataset, regardless of width.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry to be unclear, and thank you so much for your help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy T.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2012 16:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98868#M20842</guid>
      <dc:creator>WendyT</dc:creator>
      <dc:date>2012-05-01T16:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98869#M20843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I think you can modify the split255 macro to call&amp;nbsp; the following macro :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro saveXlsx(dsn,xlsxFile,sheet=&amp;amp;dsn,lib=WORK); &lt;BR /&gt;libname _xl Excel "&amp;amp;xlsxFile." version=2007;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;drop table _xl.&amp;amp;sheet.;&lt;BR /&gt;select catx(" ", name, "as", quote(translate(trim(label),"#","."))) &lt;BR /&gt;into :renames separated by "," &lt;BR /&gt;from dictionary.columns &lt;BR /&gt;where libname=upcase("&amp;amp;lib.") and memname=upcase("&amp;amp;dsn.");&lt;BR /&gt;proc sql dquote=ansi;&lt;BR /&gt;create table _xl.&amp;amp;sheet. as &lt;BR /&gt;select &amp;amp;renames. from &amp;amp;lib..&amp;amp;dsn.;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;libname _xl clear;&lt;BR /&gt;%mend saveXlsx;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simply replace :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc export data=subset&amp;amp;i outfile="&amp;amp;xlsname" &lt;/P&gt;&lt;P&gt;dbms=excel replace;&lt;/P&gt;&lt;P&gt;sheet="&amp;amp;sheetname&amp;amp;i";&lt;/P&gt;&lt;P&gt;run; quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in split255 with :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%saveXlsx(subset&amp;amp;i,&amp;amp;xlsname,sheet=&amp;amp;sheetname&amp;amp;i);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2012 17:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98869#M20843</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-05-01T17:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98870#M20844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PGStats-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked beautifully... until I had labels too long to be SAS column names.&amp;nbsp; Drat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable RENAMES resolves to STATION as "Station Name",DATE&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as "Date Numeric",SASDATE as "Date",TIME as "Time",SJR_TYPE as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Sample Type",SUB_PROJ as "Subproject Name",WATERT as "Water&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Temp",WATERT_ as "Water Temp remark"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;going well ... until...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;NOTE: Line generated by the macro variable "RENAMES".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Secchi-in remark",DEPTH10 as "Depth to 10% of Surface Light",DEPTH10_ as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;16&amp;nbsp; !&amp;nbsp; "Depth to 10% of Surface Light remark",STAGE as "Stage",STAGE_ as "Stage&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;16&amp;nbsp; ! remark",BOD5 as "BOD",BOD5_ as "BOD remark",APPCOLOR as "Apparent&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;16&amp;nbsp; ! Color-Unfiltered",APPCOLOR_ as "Apparent&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;ERROR 65-58: Name 'Depth to 10% of Surface Light remark' is too long for a SAS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name in this context.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...but once I looked at the LOG for awhile, your awesome catx() put me on to what will be my answer - changing 'as' to '=' will give me the business end of a LABEL statement!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, I should be able to put the following code at the front of %split255, reset the pointers in the macro to TEMP, and I (hopefully) will have it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;select catx(" ", NAME, "=", quote(translate(trim(label),"#","."))) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;into :relabel separated by " " &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;from dictionary.columns &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;where libname=upcase("&amp;amp;lib.") and memname=upcase("&amp;amp;dsn.") AND LABEL CONTAINS '.' ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;quit ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;data temp ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;set &amp;amp;lib..&amp;amp;dsn ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;label &amp;amp;relabel ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;run ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;SYMBOLGEN:&amp;nbsp; Macro variable RELABEL resolves to PH = "pH-# dot Field" DO =&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Diss# Oxy#" SECCHI_IN = "Secchi-in#"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;1974&amp;nbsp; %PUT &amp;amp;RELABEL ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;PH = "pH-# dot Field" DO = "Diss# Oxy#" SECCHI_IN = "Secchi-in#"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;1975&amp;nbsp; RUN ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'SAS Monospace'; font-size: 8pt;"&gt;1976&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll post when I get a working version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!!!&amp;nbsp; I can't begin to tell you how much I appreciate your help!!!&amp;nbsp;&amp;nbsp; :smileygrin:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2012 20:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98870#M20844</guid>
      <dc:creator>WendyT</dc:creator>
      <dc:date>2012-05-01T20:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98871#M20845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many, many thanks to PGStats, who gave me the inspiration with the catx() above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this macro as part of a 'canned' water quality retrieval from our main Oracle database.&amp;nbsp; It is run in the early morning by batch jobs, and creates SAS datasets and exports subsets to Excel.&amp;nbsp; Macro variables used in the retrieval determine the locations, WQ parameters of interest, etc. and the current number of columns varies from 100 to 400 or so, depending on what is requested. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, PROC EXPORT to Excel is limited to 255 columns, and the %split255 macro will split the output over as many tabs as needed in the same workbook.&amp;nbsp; Also, Excel does not accept column headers containing a dot.&amp;nbsp; Thus, the need to translate labels.&amp;nbsp; I also wanted to add and use row number as a column across tabs in the workbook, because the selections may not all have a common set of columns. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm sure this can be done better - I had to add ROW to the second LABEL statement to account for cases where none of the original labels contained dots.&amp;nbsp; Originally, I did not have the WHERE restriction in the SQL for the labels, but it was much slower, and I did not want to hit the limit on macro variable length.&amp;nbsp; I tinkered with a count of the labels containing . and some %if %then, but couldn't quite get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for the help, and any suggestions for improvements would be very welcome!&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy T&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My additions to the %split255 macro:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set some of the macro variables in the original to values I will typically use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Locally define two macro variables (and set to null):&lt;/P&gt;&lt;P&gt; &amp;amp;ORLABEL to hold the original label values with .&lt;/P&gt;&lt;P&gt; &amp;amp;RELABEL to hold the transformed label values with #&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Set the dataset to itself, and generate the row number with _N_ as ROW to use as a common column on all sheets, and LABEL ROW and &amp;amp;RELABEL to get #&amp;nbsp; labels for export to Excel. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then run the original %split255 macro code with the LABEL option added to PROC EXPORT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end of the original code, set the dataset to itself again, LABEL ROW and &amp;amp;ORLABEL to return . to the labels. Then drop ROW to have the original dataset again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro split255(mylibref=,sasdsname=,tempds=,xlsname=,sheetname=,deleteit=,varcom=,comname=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*&lt;/SPAN&gt;set some of the macro variable values *;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%LET tempdir=D:\SASData\&amp;amp;SYSUSERID ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%LET tempds=subgroup ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%LET sheetname=datasheet ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*define local macro variables for original and transformed labels*;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%LOCAL RELABEL ORLABEL ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%LET RELABEL= ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%LET ORLABEL= ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*obtain values for original and transformed labels*;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;proc sql noprint;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;select catx(" ", NAME, "=", quote(trim(label))) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;into :orlabel separated by " " &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;from dictionary.columns &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;where libname=upcase("&amp;amp;mylibref.") and memname=upcase("&amp;amp;sasdsname.") AND LABEL CONTAINS '.' ; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%PUT &amp;amp;ORLABEL ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;select catx(" ", NAME, "=", quote(translate(trim(label),"#",".")))&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;into :relabel separated by " " &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;from dictionary.columns &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;where libname=upcase("&amp;amp;mylibref.") and memname=upcase("&amp;amp;sasdsname.") AND LABEL CONTAINS '.' ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%PUT &amp;amp;RELABEL ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;quit ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RUN ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*set dataset to itself&amp;nbsp; generate row number and add ROW label and relabel if needed* ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DATA &amp;amp;mylibref..&amp;amp;sasdsname ; SET &amp;amp;mylibref..&amp;amp;sasdsname ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ROW=_N_&amp;nbsp; ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LABEL ROW='Row in SAS dataset' &amp;amp;RELABEL ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RUN ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*begin original macro code*;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table testcols as&lt;/P&gt;&lt;P&gt;select * from dictionary.columns&lt;/P&gt;&lt;P&gt;where libname=upcase("&amp;amp;mylibref") and memname=upcase("&amp;amp;sasdsname");&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;****** etc********&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%end;&lt;BR /&gt;%mend loopit;&lt;BR /&gt;%loopit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*end of original macro code ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*set dataset back to itself then label ROW and back to original label(s) containing . *;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*label for ROW is only present to placehold if &amp;amp;ORLABEL is null* ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;*drop ROW to get original dataset* ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DATA &amp;amp;mylibref..&amp;amp;sasdsname ; SET &amp;amp;mylibref..&amp;amp;sasdsname ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LABEL ROW='Row in SAS dataset' &amp;amp;ORLABEL ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP ROW ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RUN ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend split255;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then I use&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;%&lt;STRONG&gt;&lt;EM&gt;split255&lt;/EM&gt;&lt;/STRONG&gt;(mylibref=&amp;amp;DATA_LIB, sasdsname=&amp;amp;DSN_OVERALL_MATRIX, xlsname=&amp;amp;OUTDIR\&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal; font-size: 10pt;"&gt;DSN_OVERALL_MATRIX.&lt;STRONG&gt;.x&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;lsx,&lt;/SPAN&gt; deleteit=destroy, varcom=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 10pt;"&gt;, comname=ROW );&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;to use ROW as the common column on the individual tabs. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 20:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98871#M20845</guid>
      <dc:creator>WendyT</dc:creator>
      <dc:date>2012-05-02T20:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98872#M20846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very nice of you to wrap this up this way. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 01:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98872#M20846</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-05-03T01:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace . in label with # for Excel output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98873#M20847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As a complement of information, I just finished writing the ExcelLoad macro that allows you to export any size of dataset to a single Excel sheet. it is located at :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="1260" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 22:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-replace-in-label-with-for-Excel-output/m-p/98873#M20847</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-05-17T22:06:33Z</dc:date>
    </item>
  </channel>
</rss>

