<?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: Is there any specific situations where character formats can be applied on numeric variables and vice versa?? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201427#M50277</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure I full yunderstand your question.&amp;nbsp; the code you have posted fails to run, as it should.&amp;nbsp; Character formats, those ones with name starting $ can only be applied to character data, those formats without the dollar can only be assigned to numeric variables.&amp;nbsp; Now in your example, the first dataset is reading the variable START in as a numeric, hence in the format step it is setting the format as numeric.&amp;nbsp; In your second datastep you are also reading xyz in as numeric.&amp;nbsp; If you change both input statements to :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;input start $ label $9.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;input xyz $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Then the code will run.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Apr 2015 10:23:08 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-04-22T10:23:08Z</dc:date>
    <item>
      <title>Is there any specific situations where character formats can be applied on numeric variables and vice versa??</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201426#M50276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data a;&lt;/P&gt;&lt;P&gt;input start label $9.;&lt;/P&gt;&lt;P&gt;fmtname="$abc";&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;101 bangalore&lt;/P&gt;&lt;P&gt;102 mangalore&lt;/P&gt;&lt;P&gt;103 mysore&lt;/P&gt;&lt;P&gt;104 bellary&lt;/P&gt;&lt;P&gt;105 davangere&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format cntlin=a;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data b;&lt;/P&gt;&lt;P&gt;input xyz;&lt;/P&gt;&lt;P&gt;format xyz $abc.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;101&lt;/P&gt;&lt;P&gt;102&lt;/P&gt;&lt;P&gt;104&lt;/P&gt;&lt;P&gt;108&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the above program, the format gets applied on the numeric variable. But when i create a numeric format and apply it on character variable, it will not work. can somebody explain to me this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Bharath.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 10:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201426#M50276</guid>
      <dc:creator>bharathtuppad</dc:creator>
      <dc:date>2015-04-22T10:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any specific situations where character formats can be applied on numeric variables and vice versa??</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201427#M50277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure I full yunderstand your question.&amp;nbsp; the code you have posted fails to run, as it should.&amp;nbsp; Character formats, those ones with name starting $ can only be applied to character data, those formats without the dollar can only be assigned to numeric variables.&amp;nbsp; Now in your example, the first dataset is reading the variable START in as a numeric, hence in the format step it is setting the format as numeric.&amp;nbsp; In your second datastep you are also reading xyz in as numeric.&amp;nbsp; If you change both input statements to :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;input start $ label $9.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;input xyz $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Then the code will run.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 10:23:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201427#M50277</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-22T10:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any specific situations where character formats can be applied on numeric variables and vice versa??</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201428#M50278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I understood why the program was runnnig in my session. I had a numeric as well as character format with the same name. Instead of applying character format, SAS was applying numeric format i guess.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 10:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201428#M50278</guid>
      <dc:creator>bharathtuppad</dc:creator>
      <dc:date>2015-04-22T10:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any specific situations where character formats can be applied on numeric variables and vice versa??</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201429#M50279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The format that got created here (abc) will be a character format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 11:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Is-there-any-specific-situations-where-character-formats-can-be/m-p/201429#M50279</guid>
      <dc:creator>bharathtuppad</dc:creator>
      <dc:date>2015-04-22T11:00:30Z</dc:date>
    </item>
  </channel>
</rss>

