<?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: what is S370FPD9.0 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875795#M346054</link>
    <description>&lt;P&gt;The&amp;nbsp;&lt;STRONG&gt;in&lt;/STRONG&gt;format has no effect on the&amp;nbsp;&lt;STRONG&gt;display&lt;/STRONG&gt; format. It just controls how data is read into the SAS environment from an external source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all, follow Maxim 1 and read the documentation:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1f6ogvbxp663tn13icvl1197roj.htm" target="_blank" rel="noopener"&gt;S370FPDw.d Informat&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;STRONG&gt;P&lt;/STRONG&gt;acked&amp;nbsp;&lt;STRONG&gt;D&lt;/STRONG&gt;ecimal format is used on IBM mainframes to store numbers. Each digit is stored in 4 bits, and the last 4-bit nibble is used for the sign. Your informat with a length of 9, without decimals, will therefore read an integer number with at most 17 digits.&lt;/P&gt;</description>
    <pubDate>Mon, 15 May 2023 11:47:01 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-05-15T11:47:01Z</dc:date>
    <item>
      <title>what is S370FPD9.0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875781#M346046</link>
      <description>&lt;P&gt;what does this format means, I read the sas documentation and dont get it&lt;/P&gt;
&lt;P&gt;S370FPD9.0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if the variable apple come in from in input statment like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input apple S370FPD9. (after an infile ".../.../amb.txt" statement)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what exactly is its format?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 09:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875781#M346046</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2023-05-15T09:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: what is S370FPD9.0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875787#M346049</link>
      <description>&lt;P&gt;Take a look a the &lt;A href="https://documentation.sas.com/doc/en/vdmmlcdc/8.1/leforinforref/p1axbgkkwfpgljn1qghqseckmlrd.htm" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;&lt;/P&gt;
&lt;H1 id="p1axbgkkwfpgljn1qghqseckmlrd" class="xis-title"&gt;S370FPD Format&lt;/H1&gt;
&lt;P class="xis-shortDescription"&gt;Writes packed decimal data in IBM mainframe format.&lt;/P&gt;
&lt;P class="xis-shortDescription"&gt;&lt;SPAN&gt;Use S370FPD&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;w&lt;/SPAN&gt;&lt;SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedValue"&gt;d&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;in other operating environments to write packed decimal data in the same format as on an IBM mainframe computer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class="tgroup"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV id="n0nhc83vt49q1en0z4hzd8zk8iyz" class="xis-paraTableFirst"&gt;Value of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="xis-codeDefaultStyle"&gt;x&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/TH&gt;
&lt;TH class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV id="n16btqat0zmzonn1ophxp9l5z13i" class="xis-paraTableFirst"&gt;Result&lt;/DIV&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV id="p09bcwtdgvep1in1rjmy2805z391" class="xis-paraTableFirst"&gt;
&lt;PRE class="xis-codeFragment"&gt;128&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD class="xis-horizontalLeft xis-verticalTop"&gt;
&lt;DIV id="p1i7he6mqid8n4n1r9kbwe5y68xf" class="xis-paraTableFirst"&gt;
&lt;PRE class="xis-codeFragment"&gt;0000128C&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Mon, 15 May 2023 10:28:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875787#M346049</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2023-05-15T10:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: what is S370FPD9.0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875795#M346054</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;STRONG&gt;in&lt;/STRONG&gt;format has no effect on the&amp;nbsp;&lt;STRONG&gt;display&lt;/STRONG&gt; format. It just controls how data is read into the SAS environment from an external source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all, follow Maxim 1 and read the documentation:&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n1f6ogvbxp663tn13icvl1197roj.htm" target="_blank" rel="noopener"&gt;S370FPDw.d Informat&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;STRONG&gt;P&lt;/STRONG&gt;acked&amp;nbsp;&lt;STRONG&gt;D&lt;/STRONG&gt;ecimal format is used on IBM mainframes to store numbers. Each digit is stored in 4 bits, and the last 4-bit nibble is used for the sign. Your informat with a length of 9, without decimals, will therefore read an integer number with at most 17 digits.&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 11:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875795#M346054</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-05-15T11:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: what is S370FPD9.0</title>
      <link>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875808#M346059</link>
      <description>&lt;P&gt;Your first problem is that this code is using an INFORMAT and not a FORMAT.&amp;nbsp; So look for the documentation on the informat, not on the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember:&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;FORMATs convert values into text.&amp;nbsp; INFORMATs convert text into values.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So that informat specification of&amp;nbsp;&lt;SPAN&gt;S370FPD9.0 says to read 9 bytes from the text file and interpret it as a binary encoded decimal value using on System 370 computers (IBM Mainframes).&amp;nbsp; The zero means that it will divide the result by 10 to the power 0 (which is just 1) to indicate where the implied decimal point will be placed.&amp;nbsp; So it is read an integer value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A packed decimal value stores one decimal digit in each nibble. (An 8 bit byte consists of two 4 bit nibbles).&amp;nbsp; This means that you are reading BINARY data from that text file and converting it into an integer number.&amp;nbsp; So if you want to check your resulting number against the value in the text file and see what it is doing you will need to print those 9 bytes using the $HEX format instead of normal $ format so you can see what each nibble contains.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The only tricky part is the last nibble is used to indicate the sign of the number.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Run some test to see what S370FPD format and informat do.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  do number=-1,0,1,1234,123456789 ;
     string = put(number,s370fpd9.0);
     format string $hex18.;
     number2 = input(string,s370fpd9.0);
     output;
  end;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1684159065894.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83978i1F1AEBCDF4DD8F2B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1684159065894.png" alt="Tom_0-1684159065894.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 May 2023 14:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/what-is-S370FPD9-0/m-p/875808#M346059</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-05-15T14:00:44Z</dc:date>
    </item>
  </channel>
</rss>

