<?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: Need Help with Proc format application. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427555#M105473</link>
    <description>&lt;P&gt;Hello KurtBremser&lt;SPAN class="login-bold"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thank you so much for your reply.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;I know this might be very small thing you, But i was not understanding the logic behind it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;1. Using an input function will convert a character variable to numeric.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;2. But if i use the input function for the below program it is not converting the character value to numeric. it is just applying the format.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
invalue &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;namefmt
  &lt;SPAN class="token string"&gt;'abc'&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;
  &lt;SPAN class="token string"&gt;'bbc'&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;
  &lt;SPAN class="token string"&gt;'ccc'&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as you advised i have created an informat&amp;nbsp; and applied in this way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;data new1;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set old;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newname=&lt;FONT color="#FF0000"&gt;input&lt;/FONT&gt;(name,&lt;FONT color="#339966"&gt;$namefmt.&lt;/FONT&gt;);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes ! now i get the output. A new variable Newname(Character variable) is created and it contains the data 1 2 and 3. but my question is Why is it a character variable? when i use a input function it should convert to numeric but why is it not converting to numeric?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same is happening with the Put function. When I use a put function it is applying the format. In general PUT function converts numeric values to character. But here if i use a&amp;nbsp; put function for a character variable it is working fine without any errors.The resultant new variable is a character again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;data bb;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set old;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newname=&lt;FONT color="#FF0000"&gt;put&lt;/FONT&gt;(name,&lt;FONT color="#339966"&gt;$namefmt.&lt;/FONT&gt;);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Both of these programs are producing the same output.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 14 Jan 2018 21:30:05 GMT</pubDate>
    <dc:creator>ssv</dc:creator>
    <dc:date>2018-01-14T21:30:05Z</dc:date>
    <item>
      <title>Need Help with Proc format application.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427418#M105397</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am facing a problem in Proc format. I was trying to convert a character variable to numeric variable by using the input function and at the same time i am applying a user defined character format to that character variable. but it is showing a warning in the log window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000"&gt;WARNING: The data set WORK.BB may be incomplete. When this step was stopped there were 0 observations and 2 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;WARNING: Data set WORK.BB was not replaced because this step was stopped.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;The program I submitted is as follows:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc format;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;value $namefmt&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'abc' = 1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'bbc' = 2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'ccc' = 3;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;data old;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;input name $;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cards;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;abc&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bbc&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ccc&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data new;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set old;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newname=&lt;FONT color="#FF0000"&gt;input&lt;/FONT&gt;(name,namefmt.);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if i use Put function in place of input function it is working fine with out any warning. But Put function usually converts Numeric to Character. But why is it working for a character variable?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;data bb;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set ab;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newname=&lt;FONT color="#FF0000"&gt;put&lt;/FONT&gt;(name,namefmt.);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If i use this program then it is working fine again.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;data bb;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set ab;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newname=&lt;FONT color="#FF0000"&gt;input(put&lt;/FONT&gt;(name,namefmt.),best.&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;;&lt;BR /&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Can some one please Clarify this?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Thanks in Advance.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 05:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427418#M105397</guid>
      <dc:creator>ssv</dc:creator>
      <dc:date>2018-01-13T05:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Proc format application.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427425#M105402</link>
      <description>&lt;P&gt;try this for the new dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; new;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; old;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;newname=name;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; newname &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$namefmt.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 05:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427425#M105402</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-01-13T05:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Proc format application.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427429#M105406</link>
      <description>&lt;P&gt;how about apply the $ before the format name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; bb;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; old;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;newname=put(name,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$namefmt.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2018 06:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427429#M105406</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-01-13T06:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Proc format application.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427433#M105408</link>
      <description>&lt;P&gt;if you want to use a format in an &lt;STRONG&gt;in&lt;/STRONG&gt;put statement, you have to create an &lt;STRONG&gt;in&lt;/STRONG&gt;format:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
invalue $namefmt
  'abc' = 1
  'bbc' = 2
  'ccc' = 3&lt;BR /&gt;;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Jan 2018 07:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427433#M105408</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-13T07:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Proc format application.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427553#M105471</link>
      <description>&lt;P&gt;Hello VDD,&lt;/P&gt;&lt;P&gt;Thank you for your reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually it is working with out any errors with or with out $ sign.&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;bb;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;old;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;newname=put(name,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#FF0000"&gt;namefmt.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;bb;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;-------------------------------------------------&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;old;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;newname=put(name,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#FF0000"&gt;$namefmt.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Both of these result in the same output.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;But my question was when we are converting a character variable to Numeric we need to use input function. and in this program i am trying to convert a character variable to numeric , (in addition i need to apply a user defined format) But if i use INPUT function it throws an error. but if i use PUT function it is fine(with or without $ sign). So why we are unable to convert character variable to numeric by applying a format using INPUT variable?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jan 2018 21:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427553#M105471</guid>
      <dc:creator>ssv</dc:creator>
      <dc:date>2018-01-14T21:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Proc format application.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427555#M105473</link>
      <description>&lt;P&gt;Hello KurtBremser&lt;SPAN class="login-bold"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Thank you so much for your reply.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;I know this might be very small thing you, But i was not understanding the logic behind it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;1. Using an input function will convert a character variable to numeric.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;2. But if i use the input function for the below program it is not converting the character value to numeric. it is just applying the format.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
invalue &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;namefmt
  &lt;SPAN class="token string"&gt;'abc'&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;
  &lt;SPAN class="token string"&gt;'bbc'&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;
  &lt;SPAN class="token string"&gt;'ccc'&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;3&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as you advised i have created an informat&amp;nbsp; and applied in this way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;data new1;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set old;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newname=&lt;FONT color="#FF0000"&gt;input&lt;/FONT&gt;(name,&lt;FONT color="#339966"&gt;$namefmt.&lt;/FONT&gt;);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes ! now i get the output. A new variable Newname(Character variable) is created and it contains the data 1 2 and 3. but my question is Why is it a character variable? when i use a input function it should convert to numeric but why is it not converting to numeric?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The same is happening with the Put function. When I use a put function it is applying the format. In general PUT function converts numeric values to character. But here if i use a&amp;nbsp; put function for a character variable it is working fine without any errors.The resultant new variable is a character again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;data bb;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;set old;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newname=&lt;FONT color="#FF0000"&gt;put&lt;/FONT&gt;(name,&lt;FONT color="#339966"&gt;$namefmt.&lt;/FONT&gt;);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="3"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Both of these programs are producing the same output.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jan 2018 21:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427555#M105473</guid>
      <dc:creator>ssv</dc:creator>
      <dc:date>2018-01-14T21:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Proc format application.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427607#M105507</link>
      <description>&lt;P&gt;If you want to have a numeric value, you have to create a numeric informat, so omit the $'s:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data old;
name = 'abc';
run;

proc format;
invalue namefmt
  'abc' = 1
  'bbc' = 2
  'ccc' = 3
;
run;

data new1;
set old;
newname=input(name,namefmt.);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Jan 2018 06:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/427607#M105507</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-15T06:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help with Proc format application.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/428139#M105675</link>
      <description>&lt;P&gt;Although not immediately obvious (and a continuing source of confusion) there is a difference between INFORMATs (used by the INPUT statement and the INPUT function) and FORMATs (used by the PUT statement and the PUT function).&amp;nbsp; The INVALUE statement in PROC FORMAT creates INFORMATs and you will notice from the previous post by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; that the type of the INFORMAT depends on the result (numeric INFORMATS yield a numeric result).&amp;nbsp; FORMATS created by the VALUE statement are numeric if the incoming value is numeric.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 19:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-Help-with-Proc-format-application/m-p/428139#M105675</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2018-01-16T19:31:04Z</dc:date>
    </item>
  </channel>
</rss>

