<?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: Help with Informats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333371#M75101</link>
    <description>&lt;P&gt;Could you provide an example of how your raw data file looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this might sove your problem&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Input Name   :$11. +1 City  :$31. / @1 Salary:comma. +1 Subject  :$23.
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 Feb 2017 14:06:37 GMT</pubDate>
    <dc:creator>gauthamk28</dc:creator>
    <dc:date>2017-02-16T14:06:37Z</dc:date>
    <item>
      <title>Help with Informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333363#M75097</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to apply multiple informats to a single variable that is "Salary". The value is like- &amp;nbsp;$25,000.50&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to import a fixed length rawfile using infile statement. The length range of this value is 1-15. How to write the input code for this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I did for single informat value -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input Name$ 1-11 City$ 13-31 / @1 Salary:comma. Subject$ 17-23;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to make it clear, there are split observation lines in my file and salary starts at 1 and end at 15.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your answers.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 13:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333363#M75097</guid>
      <dc:creator>Mansi</dc:creator>
      <dc:date>2017-02-16T13:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333371#M75101</link>
      <description>&lt;P&gt;Could you provide an example of how your raw data file looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this might sove your problem&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Input Name   :$11. +1 City  :$31. / @1 Salary:comma. +1 Subject  :$23.
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2017 14:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333371#M75101</guid>
      <dc:creator>gauthamk28</dc:creator>
      <dc:date>2017-02-16T14:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333380#M75105</link>
      <description>&lt;P&gt;Hi Gautham,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks you for your reply. Below is the sample observation lines from the file -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Terence &amp;nbsp; &amp;nbsp; &amp;nbsp;Mumbai &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;$24,00.20 &amp;nbsp; &amp;nbsp; &amp;nbsp; Spanish&lt;BR /&gt;Shruti &amp;nbsp; &amp;nbsp; &amp;nbsp; Bangalore&lt;BR /&gt;$22,00.50 &amp;nbsp; &amp;nbsp; &amp;nbsp; German&lt;BR /&gt;Nivita &amp;nbsp; &amp;nbsp; &amp;nbsp; Indore&lt;BR /&gt;$25,00.00 &amp;nbsp; &amp;nbsp; &amp;nbsp; Belgian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inputs are - &amp;nbsp;Name$ 1-12 City$ 14-26 &amp;nbsp;Salary 1-15 Language$ 17-24&lt;/P&gt;&lt;P&gt;I am not sure how to put salary since it has got Comma and dollar both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 14:16:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333380#M75105</guid>
      <dc:creator>Mansi</dc:creator>
      <dc:date>2017-02-16T14:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333387#M75109</link>
      <description>did u try dollar9.2</description>
      <pubDate>Thu, 16 Feb 2017 14:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333387#M75109</guid>
      <dc:creator>gauthamk28</dc:creator>
      <dc:date>2017-02-16T14:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333389#M75110</link>
      <description>&lt;P&gt;Sounds like your data is in fixed column locations. &amp;nbsp;To use an INFORMAT with fixed column data you need to specify the width in the INFORMAT value rather than using column ranges.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input
   Name $ 1-11 City $ 13-31 
 / @1 Salary comma15. Subject $ 17-23
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that to read numeric data that contains both $ and commas you can just use the COMMA informat. It will strip out the $ and the commas and then read the result like a normal number. &amp;nbsp;Also do NOT add a decimal part to the INFORMAT unless your source data has deliberately not included the period and you want to tell SAS where to assume the period should be. &amp;nbsp;If you read '1234' using 4.2 informat it will read it as 12.34 instead of 1,234.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to display the result using the $ then you need to attach the DOLLAR format to the variable using a FORMAT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 14:32:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333389#M75110</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-02-16T14:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333400#M75118</link>
      <description>Yes, just tried after you said. It did work. Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So I have a question, if we are using dollar then don't we need to use the comma informat anymore?</description>
      <pubDate>Thu, 16 Feb 2017 14:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333400#M75118</guid>
      <dc:creator>Mansi</dc:creator>
      <dc:date>2017-02-16T14:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Informats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333403#M75119</link>
      <description>Hi Tom,&lt;BR /&gt;&lt;BR /&gt;Thank you so much for your detailed response. This is exactly what I wanted to know. In my statement I was confused how to apply both, Comma and dollar to a variable. Now this makes my concept clear.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 16 Feb 2017 14:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-Informats/m-p/333403#M75119</guid>
      <dc:creator>Mansi</dc:creator>
      <dc:date>2017-02-16T14:55:08Z</dc:date>
    </item>
  </channel>
</rss>

