<?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: Import correct format from an excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890394#M351825</link>
    <description>&lt;P&gt;No.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see how Excel is storing that information you could try unpacking the zipped XML files that make up an XLSX file.&amp;nbsp; You could perhaps write your own method of extracting the text with whatever markup characters Excel has stored to make it possible for excel to change fonts, colors, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could have Excel write the data to an HTML file and then try to parse the HTML code for the text of interest and see what html codes Excel generated to mimic the text markups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In terms of reproducing such mid string changes in text you will have to store ODS escape sequences into the text strings.&amp;nbsp; Then when you print the values using ODS output (to say EXCEL or HTML of PDF files) then you might be able to recreate the appearance of the text in the EXCEL file.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2023 14:36:35 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-08-22T14:36:35Z</dc:date>
    <item>
      <title>Import correct format from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890379#M351815</link>
      <description>&lt;DIV class="flex flex-grow flex-col gap-3"&gt;
&lt;DIV class="min-h-[20px] flex flex-col items-start gap-3 overflow-x-auto whitespace-pre-wrap break-words"&gt;
&lt;DIV class="markdown prose w-full break-words dark:prose-invert light"&gt;
&lt;P&gt;Greetings,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm in the process of importing character variables from an Excel file, and I've observed that SAS doesn't carry over the formatting from Excel. For instance, text formatted as bold in Excel appears as plain text after importing. I considered the possibility of modifying the data within Excel in a manner that would prompt SAS to automatically apply formatting (like using &lt;EM&gt;asterisks&lt;/EM&gt; in Excel to indicate text that should be imported as bold into SAS). However, I haven't come across any information regarding this approach. Is there a method to import the applied formatting along with the data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 22 Aug 2023 12:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890379#M351815</guid>
      <dc:creator>_Manhattan</dc:creator>
      <dc:date>2023-08-22T12:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import correct format from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890382#M351818</link>
      <description>&lt;P&gt;Do you mean you want bold in Excel to show us as bold in SAS? There is no such thing as bold text in a SAS data set.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 13:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890382#M351818</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-22T13:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import correct format from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890388#M351821</link>
      <description>&lt;P&gt;Well yes, that is more or less what I am talking about. As far as I know, it is possible to change the font format inside of a proc step (e. g. proc report). But as I am preparing my data in Excel I was hoping that there is an easier way than writing separate code for every single word that needs to be bold or underlined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 14:02:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890388#M351821</guid>
      <dc:creator>_Manhattan</dc:creator>
      <dc:date>2023-08-22T14:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Import correct format from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890389#M351822</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418960"&gt;@_Manhattan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Well yes, that is more or less what I am talking about. As far as I know, it is possible to change the font format inside of a proc step (e. g. proc report). But as I am preparing my data in Excel I was hoping that there is an easier way than writing separate code for every single word that needs to be bold or underlined.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PROC REPORT and PROC TABULATE (and possibly a few other PROCs that I can't think of right now) allow bold output. I am not aware of a way for SAS to know that certain text or numbers it just read from Excel was bold in Excel.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 14:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890389#M351822</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-22T14:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Import correct format from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890390#M351823</link>
      <description>&lt;P&gt;A character variable in SAS is just a sequence of bytes. There is no place in the header of a dataset to store fonts or the like.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 14:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890390#M351823</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-08-22T14:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Import correct format from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890391#M351824</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418960"&gt;@_Manhattan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Well yes, that is more or less what I am talking about. As far as I know, it is possible to change the font format inside of a proc step (e. g. proc report). But as I am preparing my data in Excel I was hoping that there is an easier way than writing separate code for every single word that needs to be bold or underlined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;To a certain extent all of that &lt;STRONG&gt;cell&lt;/STRONG&gt; level, if not just part of cell, formatting is inappropriate for any data system that sets properties on a variable ("column") level. Microsoft SQL Server and Access data bases do not maintain such.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without explicit examples it is hard to make appropriate suggestions but I have received files where cell level formatting, cell background color, for example contains information that belongs in another variable, such as a condition flag value to indicate that information.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 14:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890391#M351824</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-22T14:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Import correct format from an excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890394#M351825</link>
      <description>&lt;P&gt;No.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see how Excel is storing that information you could try unpacking the zipped XML files that make up an XLSX file.&amp;nbsp; You could perhaps write your own method of extracting the text with whatever markup characters Excel has stored to make it possible for excel to change fonts, colors, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could have Excel write the data to an HTML file and then try to parse the HTML code for the text of interest and see what html codes Excel generated to mimic the text markups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In terms of reproducing such mid string changes in text you will have to store ODS escape sequences into the text strings.&amp;nbsp; Then when you print the values using ODS output (to say EXCEL or HTML of PDF files) then you might be able to recreate the appearance of the text in the EXCEL file.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 14:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-correct-format-from-an-excel-file/m-p/890394#M351825</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-22T14:36:35Z</dc:date>
    </item>
  </channel>
</rss>

