<?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 Use a dataset to provide the format to an argument for a put statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457713#M116074</link>
    <description>&lt;P&gt;I have a data set that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 1129px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20163iD11153B50FF16B1F/image-dimensions/1129x79?v=v2" width="1129" height="79" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where "response" is a formatted column (actual values are numeric: 1,2, 3). I have the correct format in the "format" column, as text.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to do something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA desired;

&amp;nbsp; &amp;nbsp; SET current_data;

&amp;nbsp; &amp;nbsp; question_fmt = put(response, format);

RUN;&lt;/PRE&gt;&lt;P&gt;Here I want the format supplied to the put argument to come from the format column. IS there a way to do this?&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2018 13:12:11 GMT</pubDate>
    <dc:creator>dewittme</dc:creator>
    <dc:date>2018-04-26T13:12:11Z</dc:date>
    <item>
      <title>Use a dataset to provide the format to an argument for a put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457713#M116074</link>
      <description>&lt;P&gt;I have a data set that looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 1129px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20163iD11153B50FF16B1F/image-dimensions/1129x79?v=v2" width="1129" height="79" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where "response" is a formatted column (actual values are numeric: 1,2, 3). I have the correct format in the "format" column, as text.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to do something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA desired;

&amp;nbsp; &amp;nbsp; SET current_data;

&amp;nbsp; &amp;nbsp; question_fmt = put(response, format);

RUN;&lt;/PRE&gt;&lt;P&gt;Here I want the format supplied to the put argument to come from the format column. IS there a way to do this?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 13:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457713#M116074</guid>
      <dc:creator>dewittme</dc:creator>
      <dc:date>2018-04-26T13:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use a dataset to provide the format to an argument for a put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457715#M116075</link>
      <description>&lt;P&gt;Please post data in a usable form (hint: pictures ar NOT useful). See my footnotes.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 13:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457715#M116075</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-26T13:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use a dataset to provide the format to an argument for a put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457719#M116076</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can use the vvalue function (Returns by Default a $200&amp;nbsp;length if not specified)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA desired;
    SET current_data;
    question_fmt = vvalue(Response);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Apr 2018 13:20:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457719#M116076</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2018-04-26T13:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Use a dataset to provide the format to an argument for a put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457720#M116077</link>
      <description>&lt;P&gt;Post test data in the form of a datastep and what you want to see out.&amp;nbsp; How are you going to store the output text with the format, as formats apply to the whole variable?&amp;nbsp; You could use a text field of course.&lt;/P&gt;
&lt;P&gt;I suspect what you are after is the putc and putn functions.&amp;nbsp; Then you pass the variable, the format name, and optionally length across:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212562.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212562.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 13:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457720#M116077</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-26T13:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use a dataset to provide the format to an argument for a put statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457746#M116094</link>
      <description>&lt;P&gt;This is exactly the function I needed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2018 13:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Use-a-dataset-to-provide-the-format-to-an-argument-for-a-put/m-p/457746#M116094</guid>
      <dc:creator>dewittme</dc:creator>
      <dc:date>2018-04-26T13:46:20Z</dc:date>
    </item>
  </channel>
</rss>

