<?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 xlsx - weird formatting on mixed columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747053#M234442</link>
    <description>&lt;P&gt;Check your SAS log.&amp;nbsp; Proc import should be generating SAS code for a DATA step behind the scenes.&amp;nbsp; What you might do is to copy that DATA step code and modify it so that the importation goes according to your rules rather than the default.&amp;nbsp; However, 100% is probably represented in Excel as a number with a format, that number being 1 in the case of 100%.&amp;nbsp; You may have to play with it.&amp;nbsp; Importing it from .csv is probably going to give you a lot more control than importing it from Excel. Your INFILE statement should probably include DSD DLM=',' for csv.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jun 2021 15:11:39 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2021-06-10T15:11:39Z</dc:date>
    <item>
      <title>Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747050#M234439</link>
      <description>&lt;P&gt;Routinely I export data from my company's Jira service desk. I have to export it as a .csv then save it as a .xlsx, otherwise SAS seems to truncate the number of variables that get imported. Anyway, one of the columns contains free text data like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="98.91899945780483%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;Ticket #&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;FTE allocation&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;001&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;002&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;100%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;003&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="30px"&gt;004&lt;/TD&gt;
&lt;TD height="30px"&gt;75-100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="30px"&gt;005&lt;/TD&gt;
&lt;TD height="30px"&gt;50%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="30px"&gt;006&lt;/TD&gt;
&lt;TD height="30px"&gt;50 to 100%&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is how the data appear in Jira and in .csv and the .xlsx prior to import. I'm using a basic import procedure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out=prr 
		datafile = "C:\Users\lbarwick\Desktop\Jira_Data.xlsx"
		dbms=xlsx replace;
	getnames=Yes; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What gets processed/imported is this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="98.91899945780483%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;Ticket #&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;FTE allocation&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;001&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;002&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;003&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="30px"&gt;004&lt;/TD&gt;
&lt;TD height="30px"&gt;75-100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="30px"&gt;005&lt;/TD&gt;
&lt;TD height="30px"&gt;0.5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD height="30px"&gt;006&lt;/TD&gt;
&lt;TD height="30px"&gt;50 to 100%&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see that whenever the value contains %, the value is changed to a fraction of a whole number, otherwise SAS seemingly is retaining the native value as text. I know mixed option is implicit, and I've tried sorting the .xlsx differently prior to import so that explicit character data are in the first few rows to see if SAS accurately interprets all rows as character data. Nothing seems to be working! Any thoughts? I've asked my IT dept about changing registry data to update typeguessrows to 0 but it can't be done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 14:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747050#M234439</guid>
      <dc:creator>lbarwick</dc:creator>
      <dc:date>2021-06-10T14:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747052#M234441</link>
      <description>Read it in from the CSV not XLSX and fix it there. You have no control over types/formats with Excel but you do with CSV. For truncation, you likely need to specify LRECL to specify the record length if you have a really wide data set.</description>
      <pubDate>Thu, 10 Jun 2021 15:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747052#M234441</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-10T15:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747053#M234442</link>
      <description>&lt;P&gt;Check your SAS log.&amp;nbsp; Proc import should be generating SAS code for a DATA step behind the scenes.&amp;nbsp; What you might do is to copy that DATA step code and modify it so that the importation goes according to your rules rather than the default.&amp;nbsp; However, 100% is probably represented in Excel as a number with a format, that number being 1 in the case of 100%.&amp;nbsp; You may have to play with it.&amp;nbsp; Importing it from .csv is probably going to give you a lot more control than importing it from Excel. Your INFILE statement should probably include DSD DLM=',' for csv.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 15:11:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747053#M234442</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-10T15:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747060#M234444</link>
      <description>&lt;P&gt;When you have mixed cells in a single column the variable is created as CHAR.&amp;nbsp; For any cell that has a numeric value instead of a string the RAW value is translated to a text string.&amp;nbsp; So any display format the cell might have attached to in the spreadsheet is lost.&amp;nbsp; SAS does the same thing with date values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have the creator of the spreadsheet make sure to define all of the cells in the column as strings instead of numbers and you will get the percent signs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 15:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747060#M234444</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-10T15:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747164#M234461</link>
      <description>Understood but the 'creator' of the spreadsheet in this case is Jira, I get the .csv as an export and then save it as .xlsx. I tried converting all of the values in this column to text and Excel will turn 100% into 1 and 50% into 0.5. The problem with this is that there could be other rows with a legitimate value of 1 (1%) so in this conversion I cannot distinguish between what was originally 100% and what was originally 1%.</description>
      <pubDate>Thu, 10 Jun 2021 17:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747164#M234461</guid>
      <dc:creator>lbarwick</dc:creator>
      <dc:date>2021-06-10T17:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747166#M234463</link>
      <description>I've tried reading it in as .csv and SAS does not like this. The file that I get out of Jira is very messy when opened as a .csv in text editor, but for some reason is structured just fine when I save the .csv as a .xlsx.</description>
      <pubDate>Thu, 10 Jun 2021 17:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747166#M234463</guid>
      <dc:creator>lbarwick</dc:creator>
      <dc:date>2021-06-10T17:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747167#M234464</link>
      <description>What does "SAS does not like this" mean?&lt;BR /&gt;Did it the error message say "SAS doesn't like your data"? &lt;BR /&gt;&lt;BR /&gt;I suspect it means your data didn't import correctly and there's various reasons this can happen but most are easily fixed. Converting your file to XLSX will cause your more issues in the long run - like you're experiencing. You can choose which problem to fix, but in my opinion it makes more sense to fix your data import from CSV than to try and decode anything after the fact. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jun 2021 17:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747167#M234464</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-10T17:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747173#M234467</link>
      <description>&lt;P&gt;The import happens just fine with .csv - the issue is with how the data are structured. Example below - .csv from Jira contains many hard returns:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lbarwick_0-1623347966575.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60232i7E40478B9DBC8F22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lbarwick_0-1623347966575.png" alt="lbarwick_0-1623347966575.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result from importing into SAS is something like this where you can see values shifted and in the wrong columns (see second and last rows - that value should not be in that column):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lbarwick_1-1623348178790.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60233i6FEF4A77B417F4AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lbarwick_1-1623348178790.png" alt="lbarwick_1-1623348178790.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to avoid as much as possible having to manually manipulate files before importing into SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 18:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747173#M234467</guid>
      <dc:creator>lbarwick</dc:creator>
      <dc:date>2021-06-10T18:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747175#M234468</link>
      <description>&lt;P&gt;Well, pick your "poison."&amp;nbsp; You can&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Save the .csv as an Excel file, but Excel is going to automatically butcher things like numbers with a percent sign.&amp;nbsp; You may be able to do something with Excel to handle the columns as text, but you'll have to play with it.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1623349169557.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60234i074766000F84EE06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1623349169557.png" alt="jimbarbour_0-1623349169557.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;Use the .csv file directly, but you'll have to do something like using the TRANSLATE function to clean out special characters.&amp;nbsp; The good news here is that you can use SAS code to clean the data; you don't have to do this manually.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;So, pick your "poison."&amp;nbsp; I don't think there's a way you can do it that doesn't involve some "fiddling" in conjunction with importing the data into SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 18:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747175#M234468</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-10T18:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747176#M234469</link>
      <description>The .csv formatting issue is due to records exported from Jira that contain hard returns (e.g. a freetext field where user added a hard return) that essentially corrupts the exported file.</description>
      <pubDate>Thu, 10 Jun 2021 18:21:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747176#M234469</guid>
      <dc:creator>lbarwick</dc:creator>
      <dc:date>2021-06-10T18:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747177#M234470</link>
      <description>I'm sort of coming to the same conclusion, my issue is I would need to manually manipulate my csv before importing it into SAS. In the excel, changing that column to text has the same exact effect I'm experiencing when importing the excel into SAS.</description>
      <pubDate>Thu, 10 Jun 2021 18:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747177#M234470</guid>
      <dc:creator>lbarwick</dc:creator>
      <dc:date>2021-06-10T18:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747178#M234471</link>
      <description>&lt;P&gt;Do you know the specific Hexidecimal value?&amp;nbsp; If so, you can use a Data step to cleanse these.&amp;nbsp; Presumably, a "hard return" is '0A'x or '0D'x (probably '0A'x).&amp;nbsp; You should be able to use TRANSLATE or COMPRESS to clean these out.&amp;nbsp; You'd probably have to read the data as a Byte stream and apply COMPRESS&lt;SPAN&gt;(VARNAME, , 'kw')' which should delete any non display characters.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Jim&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 18:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747178#M234471</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-10T18:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747179#M234472</link>
      <description>&lt;P&gt;It is&amp;nbsp; generally not hard to fix a delimited text file that has embedded end of line characters so that SAS can read it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might not even need to change the text file at all.&amp;nbsp; If JIRA has generated the lines with CR+LF at the end and used only LF or only CR when inserting line breaks into the middle of the values of some of the fields.&amp;nbsp; Or if the lines always end with LF and the embedded line break character is always a CR (or the reverse).&amp;nbsp; Just use the TERMSTR= option on the INFILE or FILENAME statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise if the text file is using proper quoting (or even proper escaping) of the values with embedded line breaks then it is not hard to convert the file into one that SAS can read. For example by replacing all of the embedded CR and/or LF characters with some other character.&amp;nbsp; If Excel can read the files then you should be able to write a SAS program to read it and fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do want to read the file into EXCEL and then save it back out just force EXCEL to read each field as CHARACTER instead of letting it guess which cells should be considered numbers.&amp;nbsp; So instead of double-clicking the CSV file to open it in Excel instead you can first start Excel and then using the data import (or where ever they have moved that option in the current release).&amp;nbsp; That way you can tell it to treat every column as TEXT.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 18:30:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747179#M234472</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-10T18:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747180#M234473</link>
      <description>&lt;P&gt;Please go support this now 3+ year old SASWARE Ballot Idea for SAS to make enhancement to allow easy processing of such text files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/Enhancements-to-INFILE-FILE-to-handle-delimited-file-variations/idi-p/435977" target="_blank"&gt;https://communities.sas.com/t5/SASware-Ballot-Ideas/Enhancements-to-INFILE-FILE-to-handle-delimited-file-variations/idi-p/435977&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 18:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747180#M234473</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-10T18:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747184#M234476</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20041"&gt;@lbarwick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I'm sort of coming to the same conclusion, my issue is I would need to manually manipulate my csv before importing it into SAS. In the excel, changing that column to text has the same exact effect I'm experiencing when importing the excel into SAS.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Don't try to fix it after EXCEL has tried to convert the text that is in the file into numbers/dates/percents.&amp;nbsp; Just make sure you tell EXCEL to read everything as TEXT to begin with.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 18:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747184#M234476</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-10T18:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747186#M234478</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20041"&gt;@lbarwick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Understood but the 'creator' of the spreadsheet in this case is Jira, I get the .csv as an export and then save it as .xlsx. I tried converting all of the values in this column to text and Excel will turn 100% into 1 and 50% into 0.5. The problem with this is that there could be other rows with a legitimate value of 1 (1%) so in this conversion I cannot distinguish between what was originally 100% and what was originally 1%.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So EXCEL is the culprit. This is a well know issue. Excel makes a lot of assumptions and converts stuff without giving you much option without going through a lot of work. Just yesterday I had an age range exported from the US census website that should be 1-21 that opening the exported file became a DATE of Jan 2021 because of EXCEL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read the CSV into SAS instead of that conversion step.&lt;/P&gt;
&lt;P&gt;If the file has the same structure then you can set all the variable properties as you want and only change in the input file name and output data set for each new file.&lt;/P&gt;
&lt;P&gt;Plus code to read CSV can be modified to read a bunch of files at one time.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 19:02:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747186#M234478</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-10T19:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747197#M234482</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20041"&gt;@lbarwick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have encountered the same problem several times, and I have found the following approach useful. There is no conversion outside SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Ged rid of the embedded line shifts. Use a data step to read the CSV file as text lines. Store the line in a retained output-line variable. Count the number of delimiters in the current line and add to the output line until it has the expected number of deliniters. Then write the&amp;nbsp;output-line variable to a temporary text file, initiate the output-line variable and counter and read next line etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.Use another data step to read the temporary file into SAS as a delimited file. I prefer to read all variables as text and convert them to numeric or dates or whatever where appropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 19:31:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747197#M234482</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-06-10T19:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747205#M234484</link>
      <description>I don't suppose you have example code for this solution?</description>
      <pubDate>Thu, 10 Jun 2021 20:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747205#M234484</guid>
      <dc:creator>lbarwick</dc:creator>
      <dc:date>2021-06-10T20:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747213#M234487</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20041"&gt;@lbarwick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I don't suppose you have example code for this solution?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There are literally dozens if not hundreds of examples on this site alone.&lt;/P&gt;
&lt;P&gt;Try a simple google search:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.google.com/search?q=%40sas.com+embedded+line+breaks+in+csv+file" target="_blank"&gt;https://www.google.com/search?q=%40sas.com+embedded+line+breaks+in+csv+file&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are a couple of solutions:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/Reading-CSV-file-with-double-quotes-line-breaks-and-spaces/td-p/505738" target="_blank"&gt;https://communities.sas.com/t5/New-SAS-User/Reading-CSV-file-with-double-quotes-line-breaks-and-spaces/td-p/505738&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-import-line-feed-or-carriage-return-values-from-csv-file/m-p/656445/highlight/true#M196822" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/How-to-import-line-feed-or-carriage-return-values-from-csv-file/m-p/656445/highlight/true#M196822&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS has even posted a note about this, but watch out as that method modifies the original file.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/26/065.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://support.sas.com/kb/26/065.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 20:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747213#M234487</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-10T20:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Import xlsx - weird formatting on mixed columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747267#M234510</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20041"&gt;@lbarwick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Understood but the 'creator' of the spreadsheet in this case is Jira, I get the .csv as an export and then save it as .xlsx. I tried converting all of the values in this column to text and Excel will turn 100% into 1 and 50% into 0.5. The problem with this is that there could be other rows with a legitimate value of 1 (1%) so in this conversion I cannot distinguish between what was originally 100% and what was originally 1%.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, don't open the csv-file with excel, write a data step to read it directly. The code depends on the contents of the file, so it is hardly possible to suggest something useful.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 04:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-xlsx-weird-formatting-on-mixed-columns/m-p/747267#M234510</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-06-11T04:27:56Z</dc:date>
    </item>
  </channel>
</rss>

