<?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: How can I format $306.16 where input data is 0030616?? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622053#M182946</link>
    <description>&lt;TABLE class="table" rules="all" frame="box" cellspacing="0" cellpadding="5" summary="Procedure Contents: Varnum"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Variables in Creation Order&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Len&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;customer_name&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;25&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;account_number&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;loan_number&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="l data"&gt;loan_date&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="l data"&gt;maturity_date&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;6&lt;/TH&gt;
&lt;TD class="l data"&gt;term&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;7&lt;/TH&gt;
&lt;TD class="l data"&gt;payment_amount&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;8&lt;/TH&gt;
&lt;TD class="l data"&gt;odd_payment_amount&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;9&lt;/TH&gt;
&lt;TD class="l data"&gt;total_of_payments&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I told you it was a number with a length of 7, so here is also a picture that says it is a number with a length of 7&lt;/P&gt;</description>
    <pubDate>Mon, 03 Feb 2020 21:22:03 GMT</pubDate>
    <dc:creator>GBL__</dc:creator>
    <dc:date>2020-02-03T21:22:03Z</dc:date>
    <item>
      <title>How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622047#M182941</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am struggling to format numeric data that is always length of 7 and contains no decimals or commas, WITH decimals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;0030316 --&amp;gt; 303.16&lt;/P&gt;
&lt;P&gt;1836960 --&amp;gt; 18369.60&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, this is easy and I am an idiot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help!!!&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 21:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622047#M182941</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2020-02-03T21:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622049#M182942</link>
      <description>&lt;P&gt;Numeric data never has leading zeros, so it is either character, or formatted somehow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please show us the PROC CONTENTS output for this variable.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 21:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622049#M182942</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-03T21:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622051#M182944</link>
      <description>&lt;P&gt;Apologies for not being clear, I am reading this data in from an external text file like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"CUSTOMER NAME","ACCOUNT NUMBER","LOAN NUMBER","LOAN DATE","MATURITY DATE","TERM","PAYMENT AMOUNT","ODD PAYMENT AMOUNT","TOTAL OF PAYMENTS" 
"******, ****","15028","28","010919","011724","060","0030616","0030616","1836960"&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 21:15:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622051#M182944</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2020-02-03T21:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622052#M182945</link>
      <description>&lt;P&gt;But I specifically asked for the PROC CONTENTS output of your SAS data set, showing the results for this variable of interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your presenting the external text file does not move us forward to understanding how to obtain the desired result.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 21:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622052#M182945</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-03T21:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622053#M182946</link>
      <description>&lt;TABLE class="table" rules="all" frame="box" cellspacing="0" cellpadding="5" summary="Procedure Contents: Varnum"&gt;&lt;COLGROUP&gt; &lt;COL /&gt;&lt;/COLGROUP&gt; &lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="c b header" colspan="4" scope="colgroup"&gt;Variables in Creation Order&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r b header" scope="col"&gt;#&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Variable&lt;/TH&gt;
&lt;TH class="l b header" scope="col"&gt;Type&lt;/TH&gt;
&lt;TH class="r b header" scope="col"&gt;Len&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;
&lt;TD class="l data"&gt;customer_name&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;25&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;
&lt;TD class="l data"&gt;account_number&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;
&lt;TD class="l data"&gt;loan_number&lt;/TD&gt;
&lt;TD class="l data"&gt;Char&lt;/TD&gt;
&lt;TD class="r data"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;
&lt;TD class="l data"&gt;loan_date&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;
&lt;TD class="l data"&gt;maturity_date&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;6&lt;/TH&gt;
&lt;TD class="l data"&gt;term&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;7&lt;/TH&gt;
&lt;TD class="l data"&gt;payment_amount&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;8&lt;/TH&gt;
&lt;TD class="l data"&gt;odd_payment_amount&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TH class="r rowheader" scope="row"&gt;9&lt;/TH&gt;
&lt;TD class="l data"&gt;total_of_payments&lt;/TD&gt;
&lt;TD class="l data"&gt;Num&lt;/TD&gt;
&lt;TD class="r data"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I told you it was a number with a length of 7, so here is also a picture that says it is a number with a length of 7&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 21:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622053#M182946</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2020-02-03T21:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622054#M182947</link>
      <description>&lt;P&gt;Edit: Ignore this&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Please try PROC CONTENTS with the DETAILS option&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;PROC CONTENTS DATA=yourdatasetname &lt;FONT color="#FF0000"&gt;DETAILS&lt;/FONT&gt;;&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;RUN:&lt;/STRIKE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 21:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622054#M182947</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-03T21:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622056#M182949</link>
      <description>&lt;P&gt;So it is numeric with length 7, so it can't have leading zeros.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the output the way you want it, use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format payment_amount dollar16.2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Feb 2020 21:31:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622056#M182949</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-03T21:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622057#M182950</link>
      <description>&lt;P&gt;When I format as dollar16.2 I get $30,616.00&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 21:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622057#M182950</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2020-02-03T21:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622064#M182953</link>
      <description>&lt;P&gt;I used&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;INPUT
		customer_name					$
		account_number					$
		loan_number					$
		loan_date					:	anydtdte6.
		maturity_date					:	anydtdte6.
		term
		payment_amount					:	best7.2
		odd_payment_amount				:	best7.2
		total_of_payments				:	best7.2&amp;nbsp;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;And then formatted it as Dollarw.d&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 22:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622064#M182953</guid>
      <dc:creator>GBL__</dc:creator>
      <dc:date>2020-02-03T22:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622066#M182954</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268542"&gt;@GBL__&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;When I format as dollar16.2 I get $30,616.00&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to divide by 100 first.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 22:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622066#M182954</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-03T22:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I format $306.16 where input data is 0030616??</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622068#M182955</link>
      <description>&lt;P&gt;The way to have SAS put in an implied decimal point when converting text to numbers is to specify the number of decimal places in the INFORMAT.&amp;nbsp; So if the field is always 7 characters wide and you want to interpret the last 2 as being after the decimal point then use the 7.2 informat.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you confused people by using the word FORMAT in your question. FORMATs are something you attach to a value that you already have in a SAS variable.&amp;nbsp; INFORMATs are what determine how to interpret text and convert it to values.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2020 22:30:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-format-306-16-where-input-data-is-0030616/m-p/622068#M182955</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-03T22:30:23Z</dc:date>
    </item>
  </channel>
</rss>

