<?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: assign a format depending of a variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/assign-a-format-depending-of-a-variable/m-p/13938#M2111</link>
    <description>Look at putC function, with this function format is an character expression.</description>
    <pubDate>Mon, 21 Feb 2011 15:25:22 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-02-21T15:25:22Z</dc:date>
    <item>
      <title>assign a format depending of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/assign-a-format-depending-of-a-variable/m-p/13937#M2110</link>
      <description>Hello dears SAS users&lt;BR /&gt;
my problem is the following&lt;BR /&gt;
take the dataset sashelp.class;&lt;BR /&gt;
i just want (i take this example to make you understand my problem)&lt;BR /&gt;
to assign the following formats &lt;BR /&gt;
if it's a girl ---&amp;gt; new_name=put (name, $Fname.);&lt;BR /&gt;
if it's a boy ---&amp;gt;new_name= put(name,$Mname.);&lt;BR /&gt;
i want to retrieve the value of sex for each line in a macro variable (of course depending of the line) and then to put something like this&lt;BR /&gt;
new_name=put(name,$&amp;amp;&amp;amp;sex&amp;amp;i.name.)&lt;BR /&gt;
in fact i have in my work to assign a format depending of the country to a numeric value&lt;BR /&gt;
there is more than 180 differents country so i cannot use the if then else facility&lt;BR /&gt;
and a good SAS developper says me that the only way to do it is by macro variable facility but in my code, i always put the format of the country of the last line and so, the results are bad &lt;BR /&gt;
more generally, how can i do to do this ?&lt;BR /&gt;
may be one idea it to cut my datastep by line but it could be so long, especially when i will have 6 000 000 of lines in my entry dataset...&lt;BR /&gt;
Should you help me&lt;BR /&gt;
Thank you very much</description>
      <pubDate>Mon, 21 Feb 2011 13:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/assign-a-format-depending-of-a-variable/m-p/13937#M2110</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-02-21T13:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: assign a format depending of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/assign-a-format-depending-of-a-variable/m-p/13938#M2111</link>
      <description>Look at putC function, with this function format is an character expression.</description>
      <pubDate>Mon, 21 Feb 2011 15:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/assign-a-format-depending-of-a-variable/m-p/13938#M2111</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-02-21T15:25:22Z</dc:date>
    </item>
  </channel>
</rss>

