<?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: Proc Export duplicating values for what should be null responses in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984076#M379655</link>
    <description>&lt;P&gt;Through something&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;suggested on my initial thread here:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Merge-duplicating-values-for-what-should-be-null-responses/m-p/984073#M379653" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Merge-duplicating-values-for-what-should-be-null-responses/m-p/984073#M379653&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up realizing the issue was occurring because SAS was defaulting "0" births as ".", which excel couldn't register as a value. So, I ended up defining a new variable as so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;data merged_2;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;set merged;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if year1="" then year1_count=0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else year1_count=year1;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if year2="" then year2_count=0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else year2_count=year2;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Then exported to excel with:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;proc export data=merged_2&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outfile="[filelocation]\merged_2.xlsx"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbms=xlsx&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;replace;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This solved the issue, and the year1_count and year2_count variables contained the correct values.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Again, sorry for the lack of information on the first threat. Should out to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;for providing some code that sparked the solution.&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 25 Feb 2026 19:54:36 GMT</pubDate>
    <dc:creator>ligbag4</dc:creator>
    <dc:date>2026-02-25T19:54:36Z</dc:date>
    <item>
      <title>Proc Export duplicating values for what should be null responses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984072#M379652</link>
      <description>&lt;P&gt;Previously posted as a Merge issue, but have now realized it's an Export issue, so staring a new thread:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to merge data sets from two different years that identify number of births, by race, by geographic location. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year1&lt;/P&gt;&lt;P&gt;Location&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # of Births&lt;/P&gt;&lt;P&gt;Location_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;&lt;P&gt;Location_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;Location_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;Location_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Race_5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Year2&lt;/P&gt;&lt;P&gt;Location&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # of Births&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;data merged;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;merge year1 (rename=(count=year1))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;year2 (rename=(count=year2));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;by Location Race;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In SAS, when I print the merged data set, I get the following (which is what I want):&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Location&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # of Births Year 1&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # of Births Year 2&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Race_1&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&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;5&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&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; 6&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&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; 7&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_5&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;However, when I then export this data as an excel file, I get the following:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;Location&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; year1&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; year2&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Race_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&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; 4&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&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;5&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&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;6&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&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;7&lt;/P&gt;&lt;P&gt;Location_1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Race_5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&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;8&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Export code I'm using:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;proc export data=merged&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outfile="[filelocation]\merged.xlsx"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbms=xlsx&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;replace;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Apologies for the confusion on the first thread. I didn't realize the issue was with the export step when I initially posted it.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Feb 2026 19:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984072#M379652</guid>
      <dc:creator>ligbag4</dc:creator>
      <dc:date>2026-02-25T19:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export duplicating values for what should be null responses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984075#M379654</link>
      <description>&lt;P&gt;As I already posted in your other thread, the data in Excel looks exactly like the PROC PRINT output.&lt;/P&gt;
&lt;P&gt;Run my code and start from there.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 19:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984075#M379654</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2026-02-25T19:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export duplicating values for what should be null responses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984076#M379655</link>
      <description>&lt;P&gt;Through something&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;suggested on my initial thread here:&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Merge-duplicating-values-for-what-should-be-null-responses/m-p/984073#M379653" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Merge-duplicating-values-for-what-should-be-null-responses/m-p/984073#M379653&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up realizing the issue was occurring because SAS was defaulting "0" births as ".", which excel couldn't register as a value. So, I ended up defining a new variable as so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;data merged_2;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;set merged;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if year1="" then year1_count=0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else year1_count=year1;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if year2="" then year2_count=0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else year2_count=year2;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Then exported to excel with:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;proc export data=merged_2&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;outfile="[filelocation]\merged_2.xlsx"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbms=xlsx&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;replace;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This solved the issue, and the year1_count and year2_count variables contained the correct values.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Again, sorry for the lack of information on the first threat. Should out to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;for providing some code that sparked the solution.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Feb 2026 19:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984076#M379655</guid>
      <dc:creator>ligbag4</dc:creator>
      <dc:date>2026-02-25T19:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export duplicating values for what should be null responses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984077#M379656</link>
      <description>&lt;P&gt;You probably have&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options missing=0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;set, which means missing values are always displayed as zeroes, and this "hides" the missing values from the unwary user.&lt;/P&gt;
&lt;P&gt;That's why we always present datasets as DATA step code, as that prevents any ambiguities. DATALINES don't lie.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 20:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984077#M379656</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2026-02-25T20:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export duplicating values for what should be null responses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984091#M379658</link>
      <description>&lt;P&gt;That does not look correct.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That data step looks incorrect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your YEAR1 variable NUMERIC or CHARACTER?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is NUMERIC then your IF condition is invalidly comparing a single space character to a number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is CHARACTER then the statement executed by the ELSE is assigning a character value to a NUMERIC variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 21:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984091#M379658</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-02-25T21:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export duplicating values for what should be null responses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984094#M379659</link>
      <description>&lt;P&gt;year1 and year 2 are both numeric. I'm not sure why there wasn't an error, or an issue with the if/else statement, but it seemed to work and the excel export had the correct values for each race and year.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 21:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984094#M379659</guid>
      <dc:creator>ligbag4</dc:creator>
      <dc:date>2026-02-25T21:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export duplicating values for what should be null responses</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984103#M379660</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/480592"&gt;@ligbag4&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;year1 and year 2 are both numeric. I'm not sure why there wasn't an error, or an issue with the if/else statement, but it seemed to work and the excel export had the correct values for each race and year.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS will try to convert text to numbers or numbers to text , but it should report in the SAS log where it had to do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to compare a number to the normal missing value then do that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if year1 = . then ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also use the MISSING() function which will work on both character and numeric variables.&amp;nbsp; And for numeric variable is will also work for special missing values like .A etc.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if missing(year1) then ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also use the COALESCE() function which would eliminate the need for the IF/THEN logic.&amp;nbsp; Or the need for making a new variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;year1 = coalesce(year1,0);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2026 23:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-duplicating-values-for-what-should-be-null-responses/m-p/984103#M379660</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-02-25T23:09:10Z</dc:date>
    </item>
  </channel>
</rss>

