<?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: Creating separate Code and Decode variables from a SAS dataset custom formats in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-separate-Code-and-Decode-variables-from-a-SAS-dataset/m-p/710997#M218952</link>
    <description>If the name of the format is stored in a DATA step variable, use PUTN instead of PUT.</description>
    <pubDate>Wed, 13 Jan 2021 06:20:02 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2021-01-13T06:20:02Z</dc:date>
    <item>
      <title>Creating separate Code and Decode variables from a SAS dataset custom formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-separate-Code-and-Decode-variables-from-a-SAS-dataset/m-p/710994#M218951</link>
      <description>&lt;P&gt;I'm receiving a SAS dataset with five integer variables (x1-x5) with different custom formats already applied. I also have the formats catalog. I want to create character variables x1_DEC through x5_DEC that contain just the decodes.&lt;/P&gt;
&lt;P&gt;I would normally solve this by using&lt;/P&gt;
&lt;P&gt;x1_DEC=put(x1, formatA.);&lt;/P&gt;
&lt;P&gt;x2_DEC=put(x2, formatB.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but that requires hardcoding the format names into the program. Is there a way to do this using vformat or some such function so that I can write something like&lt;/P&gt;
&lt;P&gt;x1_DEC=put(vformat(x1));&lt;/P&gt;
&lt;P&gt;that would dynamically read the currently assigned format?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 06:10:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-separate-Code-and-Decode-variables-from-a-SAS-dataset/m-p/710994#M218951</guid>
      <dc:creator>pteranodon</dc:creator>
      <dc:date>2021-01-13T06:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating separate Code and Decode variables from a SAS dataset custom formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-separate-Code-and-Decode-variables-from-a-SAS-dataset/m-p/710997#M218952</link>
      <description>If the name of the format is stored in a DATA step variable, use PUTN instead of PUT.</description>
      <pubDate>Wed, 13 Jan 2021 06:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-separate-Code-and-Decode-variables-from-a-SAS-dataset/m-p/710997#M218952</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-01-13T06:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating separate Code and Decode variables from a SAS dataset custom formats</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-separate-Code-and-Decode-variables-from-a-SAS-dataset/m-p/710998#M218953</link>
      <description>&lt;P&gt;You can use vvalue to get the formatted value of variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x1_Dec = vvalue(x1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jan 2021 06:22:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-separate-Code-and-Decode-variables-from-a-SAS-dataset/m-p/710998#M218953</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-01-13T06:22:14Z</dc:date>
    </item>
  </channel>
</rss>

