<?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: Zoned Decimal # - missing decimal point in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591238#M169339</link>
    <description>&lt;P&gt;i get the decimal point now based on using "Y=PUT(X,7.3);"&amp;nbsp; &amp;nbsp;But, the leading sign is gone from the positive #'s.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _NULL_;     
  INPUT X ZD5.3; 
  Y=PUT(X,7.3);  
  PUTLOG X= Y=;  
DATALINES;       
0025{            
0025}            
1234A            
;                
RUN;             &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;log:&lt;/P&gt;&lt;P&gt;X=0.25 Y=0.250&lt;BR /&gt;X=-0.25 Y=-0.250&lt;BR /&gt;X=12.341 Y=12.341&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example input:&lt;CODE class=" language-sas"&gt;&amp;nbsp;1234A should be output as: +12.341&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2019 17:27:48 GMT</pubDate>
    <dc:creator>sasDante</dc:creator>
    <dc:date>2019-09-24T17:27:48Z</dc:date>
    <item>
      <title>Zoned Decimal # - missing decimal point</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591210#M169329</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm reading in zoned decimal # with a decimal point, ZD, and converting to&amp;nbsp;S370FZDS.&amp;nbsp; When i PUTLOG the S370FZDS var, the decimal point is missing in the log.&amp;nbsp; How do i get the decimal point to display?&lt;BR /&gt;Example I have an input # as: 0120{ I would like the output to be +01.200&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _NULL_;           
  INPUT X ZD5.3;       
  Y=PUT(X,S370FZDS7.3);
                       
  PUTLOG X= Y=;        
DATALINES;             
0025{                  
0025}                  
1234A                  
;                      
RUN;                   &lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;output:
X=0.25 Y=+000250   
X=-0.25 Y=-000250  
X=12.341 Y=+012341 

The decimal point is missing from y variable&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 16:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591210#M169329</guid>
      <dc:creator>sasDante</dc:creator>
      <dc:date>2019-09-24T16:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Zoned Decimal # - missing decimal point</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591228#M169335</link>
      <description>&lt;P&gt;The format you have used to display Y isn't correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;s370fzds7.3&lt;/STRONG&gt; as informat, that is equivalent to the informat&lt;STRONG&gt; ZD5.3&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; you have used, probably in MF.&lt;/P&gt;
&lt;P&gt;In order to get right result use format 5.3 or comma5.3:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;y = put(x, 5.3);  

/*or*/ y = put(x, comma5.3);

/*or*/ put y 5.3;  /* show in log */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 16:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591228#M169335</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-09-24T16:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Zoned Decimal # - missing decimal point</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591238#M169339</link>
      <description>&lt;P&gt;i get the decimal point now based on using "Y=PUT(X,7.3);"&amp;nbsp; &amp;nbsp;But, the leading sign is gone from the positive #'s.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _NULL_;     
  INPUT X ZD5.3; 
  Y=PUT(X,7.3);  
  PUTLOG X= Y=;  
DATALINES;       
0025{            
0025}            
1234A            
;                
RUN;             &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;log:&lt;/P&gt;&lt;P&gt;X=0.25 Y=0.250&lt;BR /&gt;X=-0.25 Y=-0.250&lt;BR /&gt;X=12.341 Y=12.341&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example input:&lt;CODE class=" language-sas"&gt;&amp;nbsp;1234A should be output as: +12.341&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 17:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591238#M169339</guid>
      <dc:creator>sasDante</dc:creator>
      <dc:date>2019-09-24T17:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Zoned Decimal # - missing decimal point</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591243#M169340</link>
      <description>&lt;P&gt;The default value is positive unless it is negative.&lt;/P&gt;
&lt;P&gt;Why do you need the + sign ?&lt;/P&gt;
&lt;P&gt;Anyway you can check the sign using function SIGN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;s = sign(&amp;lt;numeric_variable&amp;gt;);
/* s=1 for positive, -1 for negative, 0 for zero */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 17:52:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591243#M169340</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-09-24T17:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Zoned Decimal # - missing decimal point</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591248#M169342</link>
      <description>&lt;P&gt;ok, thx.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The recipient of the file would like to see both positive &amp;amp; negative signs in front of every number.&amp;nbsp; They would like an explicit indication of&lt;/P&gt;&lt;P&gt;a number's sign.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason i had chosen,&amp;nbsp;&lt;SPAN&gt;S370FZDS is because the documentation says, &lt;/SPAN&gt;&lt;SPAN&gt;"Leading sign of – (hexadecimal 60) or + (hexadecimal 4E)".&amp;nbsp; Is there something here i'm not understanding?&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I had thought this would be&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;the format to use to get leading signs in the output along with any required decimal point.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In my example, i was hoping that an input value of 1234A would be output as +12.341 by using format&amp;nbsp;S370FZDS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 18:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591248#M169342</guid>
      <dc:creator>sasDante</dc:creator>
      <dc:date>2019-09-24T18:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Zoned Decimal # - missing decimal point</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591268#M169347</link>
      <description>&lt;P&gt;What SAS platform are using?&lt;/P&gt;
&lt;P&gt;I worked long time ago on MF. Now I'm using SAS University Edition with windows.&lt;/P&gt;
&lt;P&gt;I cant find any format to force the + sign for positive values.&lt;/P&gt;
&lt;P&gt;The only way I know is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
   value sgn
     -1 = '-'
     0  = ' '
     1  = '+
; run;

data test;
    x = 1234A; output;
    x = 5432M; output;
    x = 0;  output;
run;
   
data result;
 set test;
       y = input(x, zd5.3);
       s = sign(y);
       if s=1 then want = cat(put(s,sgn.), put(y,7.3));
       else        want = put(y,7.3);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 19:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591268#M169347</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-09-24T19:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Zoned Decimal # - missing decimal point</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591299#M169353</link>
      <description>&lt;P&gt;Not sure if this what is needed but possibly a picture format can suffice:&lt;/P&gt;
&lt;PRE&gt;Proc format library=work;
picture sign
low -&amp;lt;0 = '0000000009.000' (prefix='-')
0       = '0' (noedit)
0&amp;lt;- high= '0000000009.000' (prefix='+')
;
run;


data work.test;
    x = '1234A'; output;
    x = '5432M'; output;
    x = '0032M'; output;
    x = '00000'; output;
run;
   
data work.result;
 set work.test;
       y = input(x, zd5.3);
       format y sign.;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Sep 2019 20:39:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zoned-Decimal-missing-decimal-point/m-p/591299#M169353</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-24T20:39:26Z</dc:date>
    </item>
  </channel>
</rss>

