<?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: Character variable format association without dollar sign. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470773#M120488</link>
    <description>&lt;P&gt;Very interesting thing.&lt;/P&gt;
&lt;P&gt;Maybe SAS is too smart . a.k.a AI technology .&lt;/P&gt;</description>
    <pubDate>Sat, 16 Jun 2018 10:39:28 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2018-06-16T10:39:28Z</dc:date>
    <item>
      <title>Character variable format association without dollar sign.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470696#M120459</link>
      <description>&lt;P&gt;It's Friday.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value xfmt  other='Num';
   value $xfmt other='Chr';
   run;
data class;
   set sashelp.class;
   format _all_ xfmt.;
   run;
proc contents varnum;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;      Variables in Creation Order

#    Variable    Type    Len    Format

1    Name        Char      8    $XFMT.
2    Sex         Char      1    $XFMT.
3    Age         Num       8    XFMT.
4    Height      Num       8    XFMT.
5    Weight      Num       8    XFMT.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;27   data class;
28      set sashelp.class;
29      format _all_ xfmt.;
30      run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Jun 2018 20:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470696#M120459</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-06-15T20:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable format association without dollar sign.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470707#M120460</link>
      <description>&lt;P&gt;This is good to know. Thanks for sharing! It simplifies the assignment of two of my favorite user-defined formats:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value miss
._-.z = 'missing'
other = 'non-missing';

value $miss
' '   = 'missing'
other = 'non-missing';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jun 2018 20:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470707#M120460</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-06-15T20:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable format association without dollar sign.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470773#M120488</link>
      <description>&lt;P&gt;Very interesting thing.&lt;/P&gt;
&lt;P&gt;Maybe SAS is too smart . a.k.a AI technology .&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 10:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470773#M120488</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-06-16T10:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Character variable format association without dollar sign.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470781#M120491</link>
      <description>&lt;P&gt;Note this trick doesn't work in PROCs at least not&amp;nbsp;SUMMARY/MEANS my favorite.&amp;nbsp;&amp;nbsp;I use a data step VIEW.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My application is passed a list of variables of mixed type.&amp;nbsp; I want to associated a format to collapse all&amp;nbsp;non-missing levels to one&amp;nbsp;similar to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;missing/not-missing example.&amp;nbsp; I "can't" use _NUMERIC_ or _CHARACTER_ because I have other variable(s) that I don't want to associated with the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This also works but changes the order of the variables in the data set.&amp;nbsp; Order in the is usually not a concern.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
   value xfmt  other='Num';
   value $xfmt other='Chr';
   run;

%let vlist=Status DeathCause AgeCHDdiag Sex;

data heart;
   set sashelp.heart(keep=&amp;amp;vlist);
   format _character_ $xfmt. _numeric_ xfmt.;
   set sashelp.heart(drop=&amp;amp;vlist);
   run;
proc contents varnum;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
  #    Variable          Type    Len    Format    Label

  1    Status            Char      5    $XFMT.
  2    DeathCause        Char     26    $XFMT.    Cause of Death
  3    AgeCHDdiag        Num       8    XFMT.     Age CHD Diagnosed
  4    Sex               Char      6    $XFMT.
  5    AgeAtStart        Num       8              Age at Start
  6    Height            Num       8
  7    Weight            Num       8
  8    Diastolic         Num       8
  9    Systolic          Num       8
 10    MRW               Num       8              Metropolitan Relative
 11    Smoking           Num       8
 12    AgeAtDeath        Num       8              Age at Death
 13    Cholesterol       Num       8
 14    Chol_Status       Char     10              Cholesterol Status
 15    BP_Status         Char      7              Blood Pressure Status
 16    Weight_Status     Char     11              Weight Status
 17    Smoking_Status    Char     17              Smoking Status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Jun 2018 13:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-variable-format-association-without-dollar-sign/m-p/470781#M120491</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-06-16T13:02:52Z</dc:date>
    </item>
  </channel>
</rss>

