<?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: Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817592#M34552</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427391"&gt;@EliajhBazarski&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi, thanks. I used format informat _all_. Only Result Viewer displays this, but viewtable not. Maybe, problem with SAS settings?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Nothing is wrong.&lt;/P&gt;
&lt;P&gt;I assume by "Result Viewer" you mean the output of some procedure.&amp;nbsp; Which procedure?&amp;nbsp; Is it PROC PRINT?&lt;/P&gt;
&lt;P&gt;If you don't give PROC PRINT a specific format to use it will try its best to make a nice output.&lt;/P&gt;
&lt;P&gt;Experiment.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input x @@;
cards;
1 2 3 4 1.1 1.2 1.1234
;
proc print data=test;
run;
proc print data=test;
 where x=int(x);
run;
proc print data=test;
  format x 4.1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs       x

 1     1.0000
 2     2.0000
 3     3.0000
 4     4.0000
 5     1.1000
 6     1.2000
 7     1.1234

Obs    x

 1     1
 2     2
 3     3
 4     4

Obs       x

 1      1.0
 2      2.0
 3      3.0
 4      4.0
 5      1.1
 6      1.2
 7      1.1
&lt;/PRE&gt;</description>
    <pubDate>Sat, 11 Jun 2022 12:59:21 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-06-11T12:59:21Z</dc:date>
    <item>
      <title>Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817566#M34544</link>
      <description>I set dataset with var A only integer: 1 3 4&lt;BR /&gt;And set dataset with var A 1.1 2.1 2.2;&lt;BR /&gt;&lt;BR /&gt;After setting together my integer values 1 3 4 turns to 1.0 3.0 4.0. Are any logical errors there, options to fix it in SAS Base?&lt;BR /&gt;</description>
      <pubDate>Sat, 11 Jun 2022 05:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817566#M34544</guid>
      <dc:creator>EliajhBazarski</dc:creator>
      <dc:date>2022-06-11T05:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817568#M34545</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427391"&gt;@EliajhBazarski&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I set dataset with var A only integer: 1 3 4&lt;BR /&gt;And set dataset with var A 1.1 2.1 2.2;&lt;BR /&gt;&lt;BR /&gt;After setting together my integer values 1 3 4 turns to 1.0 3.0 4.0. Are any logical errors there, options to fix it in SAS Base?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Numbers are numbers.&amp;nbsp; There is no difference between 1 and 1.0 or for that matter 00001 and 1.00000.&amp;nbsp; It is all the number one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely the reason is that the other dataset is using a different FORMAT to display the values. When you combine two or more dataset that have the same variable the first format the data step compiler sees is the one that is used.&amp;nbsp; So if the first dataset in the SET statement did no have any special format attached to the variable and the second one did then that is the format that will be attached to the variable in the new dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or it is just that it is displaying the values for the variable with a consistent number of decimal places across all observations.&amp;nbsp; And now that some of the values are non-integers it is displaying the decimal places for all of the values.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2022 05:47:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817568#M34545</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-11T05:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817571#M34546</link>
      <description>I guess that  It is because var A in the first dataset have a different format with the second dataset.&lt;BR /&gt;Try &lt;BR /&gt;format A best.;&lt;BR /&gt;after setting together .</description>
      <pubDate>Sat, 11 Jun 2022 06:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817571#M34546</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-06-11T06:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817572#M34547</link>
      <description>Hi, thanks a lot! You upgrade my knowledge in SAS.&lt;BR /&gt;It's weird problem, because I use format informat _all_. When I watch it from Viewtable there is no problem, only Resultviewer do it🤷</description>
      <pubDate>Sat, 11 Jun 2022 06:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817572#M34547</guid>
      <dc:creator>EliajhBazarski</dc:creator>
      <dc:date>2022-06-11T06:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817573#M34548</link>
      <description>Hi, thanks. I used format informat _all_. Only Result Viewer displays this, but viewtable not. Maybe, problem with SAS settings?</description>
      <pubDate>Sat, 11 Jun 2022 06:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817573#M34548</guid>
      <dc:creator>EliajhBazarski</dc:creator>
      <dc:date>2022-06-11T06:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817575#M34549</link>
      <description>&lt;P&gt;INFORMAT is irrelevant here, as informats control how data is&amp;nbsp;&lt;EM&gt;read&lt;/EM&gt;, not how it is&amp;nbsp;&lt;EM&gt;displayed&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jun 2022 07:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817575#M34549</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-06-11T07:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817592#M34552</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427391"&gt;@EliajhBazarski&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi, thanks. I used format informat _all_. Only Result Viewer displays this, but viewtable not. Maybe, problem with SAS settings?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Nothing is wrong.&lt;/P&gt;
&lt;P&gt;I assume by "Result Viewer" you mean the output of some procedure.&amp;nbsp; Which procedure?&amp;nbsp; Is it PROC PRINT?&lt;/P&gt;
&lt;P&gt;If you don't give PROC PRINT a specific format to use it will try its best to make a nice output.&lt;/P&gt;
&lt;P&gt;Experiment.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input x @@;
cards;
1 2 3 4 1.1 1.2 1.1234
;
proc print data=test;
run;
proc print data=test;
 where x=int(x);
run;
proc print data=test;
  format x 4.1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs       x

 1     1.0000
 2     2.0000
 3     3.0000
 4     4.0000
 5     1.1000
 6     1.2000
 7     1.1234

Obs    x

 1     1
 2     2
 3     3
 4     4

Obs       x

 1      1.0
 2      2.0
 3      3.0
 4      4.0
 5      1.1
 6      1.2
 7      1.1
&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Jun 2022 12:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817592#M34552</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-11T12:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why after set two datasets,  integer value in var exmpl: 4, turns to 4.0?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817606#M34554</link>
      <description>Thank you!! It is only nice output with proc print. No problem) I am grateful for you!</description>
      <pubDate>Sat, 11 Jun 2022 18:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Why-after-set-two-datasets-integer-value-in-var-exmpl-4-turns-to/m-p/817606#M34554</guid>
      <dc:creator>EliajhBazarski</dc:creator>
      <dc:date>2022-06-11T18:36:59Z</dc:date>
    </item>
  </channel>
</rss>

