<?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 to format variable in data step using format name from data set? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-variable-in-data-step-using-format-name-from-data/m-p/276165#M55316</link>
    <description>That was fast, thanks!!</description>
    <pubDate>Thu, 09 Jun 2016 06:34:56 GMT</pubDate>
    <dc:creator>jb3</dc:creator>
    <dc:date>2016-06-09T06:34:56Z</dc:date>
    <item>
      <title>How to format variable in data step using format name from data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-variable-in-data-step-using-format-name-from-data/m-p/275192#M55001</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to format numeric values (variable "Value" in the SAS code below)&amp;nbsp;in a data step and save the formatted string in a new variable "FormattedValue". The name of the format to use is saved in the data step, too, and can be different for each row&amp;nbsp;of the data set (Variable "FormatString").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I achieve this? Thanks for your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jonas&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
	input Value FormatString $;
	length FormattedValue $ 64;
	datalines;
		120.5 dollar8.2
		120.1 8.2
		503.6 8.0	
		;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Jun 2016 19:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-variable-in-data-step-using-format-name-from-data/m-p/275192#M55001</guid>
      <dc:creator>jb3</dc:creator>
      <dc:date>2016-06-04T19:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to format variable in data step using format name from data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-variable-in-data-step-using-format-name-from-data/m-p/275193#M55002</link>
      <description>&lt;P&gt;Use the PUTN() function.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FormattedValue = putn(Value, FormatString) ;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Jun 2016 20:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-variable-in-data-step-using-format-name-from-data/m-p/275193#M55002</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-06-04T20:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to format variable in data step using format name from data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-format-variable-in-data-step-using-format-name-from-data/m-p/276165#M55316</link>
      <description>That was fast, thanks!!</description>
      <pubDate>Thu, 09 Jun 2016 06:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-format-variable-in-data-step-using-format-name-from-data/m-p/276165#M55316</guid>
      <dc:creator>jb3</dc:creator>
      <dc:date>2016-06-09T06:34:56Z</dc:date>
    </item>
  </channel>
</rss>

