<?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: Matching Data in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587212#M14641</link>
    <description>&lt;P&gt;thanks again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will study this option as well. for now I think I will use the format step. One more question on that, how can I add something for "else" values?&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2019 12:34:49 GMT</pubDate>
    <dc:creator>Jens89</dc:creator>
    <dc:date>2019-09-09T12:34:49Z</dc:date>
    <item>
      <title>Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587189#M14626</link>
      <description>&lt;P&gt;I have a column with different values. I want to create a new column which matches those values those specific values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;possible values I want to match the&amp;nbsp;values out&amp;nbsp;of my column to&amp;nbsp;: 'a', 'b', 'c', 'd' (these are not in a column)&lt;/P&gt;&lt;P&gt;I would want to match them as following 1: 'a', 2:'b', 3:'c', 5: 'd'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;desired output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a&lt;/P&gt;&lt;P&gt;b&lt;/P&gt;&lt;P&gt;c&lt;/P&gt;&lt;P&gt;d&lt;/P&gt;&lt;P&gt;b&lt;/P&gt;&lt;P&gt;c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at the moment I have something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if key= '1' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;val = 'a'&lt;/P&gt;&lt;P&gt;else if key = '2' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;val = 'b'&lt;/P&gt;&lt;P&gt;else if key = '3' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;val = 'c'&lt;/P&gt;&lt;P&gt;else if key = '5' then&lt;/P&gt;&lt;P&gt;val = 'd'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have many values so I would like to make this more efficient&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 10:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587189#M14626</guid>
      <dc:creator>Jens89</dc:creator>
      <dc:date>2019-09-09T10:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587191#M14627</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/283672"&gt;@Jens89&lt;/a&gt;&amp;nbsp;hi and welcome to the SAS Community &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, there is a more efficient solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But what value do you want eg 30 to take?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 10:41:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587191#M14627</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-09T10:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587193#M14629</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added an exhaustive list as an example, so all the values that I mentioned, I have a map for.&lt;/P&gt;&lt;P&gt;So, in this example, there would be no 30 value or any other value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data that I'm working with is different but I just provided a short example.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 10:45:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587193#M14629</guid>
      <dc:creator>Jens89</dc:creator>
      <dc:date>2019-09-09T10:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587195#M14631</link>
      <description>&lt;P&gt;Well, the data you have posted is simple, so here is a simple answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x;
datalines;
1
2
3
5
2
3
;

data want;
    set have;
    y=translate(put(x, $1.), 'ABCDE', '12345');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Try that out on your actual data. If you run into trouble, then don't hesitate to ask again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 10:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587195#M14631</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-09T10:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587198#M14632</link>
      <description>&lt;P&gt;thanks for the swift response again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I need to be able to list the values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to apply it specifically to my data. some examples&amp;nbsp;of the values the numbers need to be matched to would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1:'analyst/technician'&lt;/P&gt;&lt;P&gt;2:'apprentice/to trade'&lt;/P&gt;&lt;P&gt;3:'Artist'&lt;/P&gt;&lt;P&gt;4:'Clerical;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 11:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587198#M14632</guid>
      <dc:creator>Jens89</dc:creator>
      <dc:date>2019-09-09T11:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587200#M14634</link>
      <description>&lt;P&gt;Ok. You can apply a custom format like this then&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
    value fmt 1='analyst/technician'
              2='apprentice/to trade'
              3='Artist'
              4='Clerical';
    ;
run;

data have;
input x;
datalines;
1
2
3
5
2
3
;

data want;
    set have;
    y=put(x, fmt. -l);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 11:09:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587200#M14634</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-09T11:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587203#M14635</link>
      <description>&lt;P&gt;that seems to work great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- I would need something for missing values. can I add that also in the proc format statement?&lt;/P&gt;&lt;P&gt;- do you have an alternative solutions where I can add this within a data step. Within my dataset I have different maps within 1 data step so I would have to create several proc steps with all the different maps. This works, but I was wondering if there is a more elegant solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks so much!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 11:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587203#M14635</guid>
      <dc:creator>Jens89</dc:creator>
      <dc:date>2019-09-09T11:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587204#M14636</link>
      <description>&lt;P&gt;No problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Yes you can add a missing value to PROC FORMAT like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
    value fmt 1='analyst/technician'
              2='apprentice/to trade'
              3='Artist'
              4='Clerical'
              .='Missing'
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2) So your 'Mapping Table'.. Do you have that in a separate data set like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data map;
input x Occupation :$50.;
datalines;
1 analyst/technician
2 apprentice/to trade
3 Artist
4 Clerical
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 11:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587204#M14636</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-09T11:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587206#M14638</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;2) So your 'Mapping Table'.. Do you have that in a separate data set like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; map&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; x Occupation :&lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;50&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token datalines"&gt;&lt;SPAN class="token keyword"&gt;datalines&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN class="token data string"&gt;1 analyst/technician
2 apprentice/to trade
3 Artist
4 Clerical&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I don't but I could create that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at the moment I have one large data step which contains lots of if elseif statements to map the values like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; APP_ICB_WORST_EVER = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'J'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;ICB_BAND_MAPPED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Bad ICB'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; APP_ICB_WORST_EVER = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'F'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;ICB_BAND_MAPPED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Bad ICB'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; APP_ICB_WORST_EVER = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'W'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;ICB_BAND_MAPPED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Bad ICB'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; APP_ICB_VISA_WORST_EVER = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'J'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;VISA_ICB_BAND_MAPPED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Bad ICB'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; APP_ICB_VISA_WORST_EVER = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'F'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;VISA_ICB_BAND_MAPPED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Bad ICB'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; APP_ICB_VISA_WORST_EVER = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'W'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;VISA_ICB_BAND_MAPPED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Bad ICB'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; APP_ICB_VISA_WORST_EVER = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Wr'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;then&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;VISA_ICB_BAND_MAPPED = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Bad ICB'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;etc.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 11:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587206#M14638</guid>
      <dc:creator>Jens89</dc:creator>
      <dc:date>2019-09-09T11:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587207#M14639</link>
      <description>&lt;P&gt;Ok. Lets say that you create a mapping table like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data map;
input x Occupation $ 3-50;
datalines;
1 analyst/technician
2 apprentice/to trade
3 Artist
4 Clerical
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can do this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=rc);
    if _N_=1 then do;
        declare hash h(dataset:'map');
        h.definekey('x');
        h.definedata('Occupation');
        h.definedone();
    end;

    set have;
    length Occupation $50;

    rc=h.find();
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 11:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587207#M14639</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-09T11:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587212#M14641</link>
      <description>&lt;P&gt;thanks again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will study this option as well. for now I think I will use the format step. One more question on that, how can I add something for "else" values?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 12:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587212#M14641</guid>
      <dc:creator>Jens89</dc:creator>
      <dc:date>2019-09-09T12:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587213#M14642</link>
      <description>&lt;P&gt;Like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
    value fmt 1='analyst/technician'
              2='apprentice/to trade'
              3='Artist'
              4='Clerical'
              .='Missing'
          other='Unknown'
    ;
run;

data have;
input x;
datalines;
1
2
3
5
2
3
.
6
;

data want;
    set have;
    y=put(x, fmt. -l);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 12:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587213#M14642</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-09T12:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587215#M14643</link>
      <description>&lt;P&gt;great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 other issues I've ran into now too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- &amp;nbsp;If there are more keys which need to be matched to the same value eg:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work out=t;
    value fmt 1='analyst/technician'
              2='apprentice/to trade'
              3='Artist'
              4='Clerical'
	      IN(5,6,7) = "manager"
              .='Missing'
          other='Unknown'
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- in the format step lib = work. in the data step,&amp;nbsp;that specific table doesn't seem to be referenced which would mean I'd run into issues with multiple proc statements. is there a way to give it a name in the proc step and reference it in the data have step?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;once again, thanks so much for your help&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 12:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587215#M14643</guid>
      <dc:creator>Jens89</dc:creator>
      <dc:date>2019-09-09T12:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587216#M14644</link>
      <description>&lt;P&gt;1) Do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
    value fmt 1='analyst/technician'
              2='apprentice/to trade'
            3,7='Artist'
              4='Clerical'
              .='Missing'
          other='Unknown'
    ;
run;

data have;
input x;
datalines;
1
2
3
5
2
3
.
6
7
;

data want;
    set have;
    y=put(x, fmt. -l);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2) The &lt;A href="https://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=n1c16dxnndwfzyn14o1kb8a4312m.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p14pdxb0wxpmr3n1a3d1sdgx4o9d" target="_self"&gt;Lib Option in the PROC FORMAT Statement&lt;/A&gt;&amp;nbsp;simply tells SAS where to store the Format. Noting else.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 12:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587216#M14644</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-09-09T12:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587218#M14645</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/283672"&gt;@Jens89&lt;/a&gt;&amp;nbsp; Sorry too late into the thread and would just add a suggestion that's meant for lazy folks like me.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since 5,6,7 are continuous, you could write your&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IN(5,6,7) = "manager"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  5:7= "manager"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format lib=work;
    value fmt 1='analyst/technician'
              2='apprentice/to trade'
              3='Artist'
              4='Clerical'
	     5:7= "manager"
              .='Missing'
          other='Unknown'
    ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 13:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587218#M14645</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-09T13:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587265#M14653</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;2) The &lt;A href="https://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=n1c16dxnndwfzyn14o1kb8a4312m.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p14pdxb0wxpmr3n1a3d1sdgx4o9d" target="_self" rel="nofollow noopener noreferrer"&gt;Lib Option in the PROC FORMAT Statement&lt;/A&gt;&amp;nbsp;simply tells SAS where to store the Format. Noting else.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is giving me an issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with the multiple proc formats, values are overriden.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 = &lt;SPAN class="token string"&gt;'analyst/technician'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token string"&gt;but then for another one &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token string"&gt;1 = 'agriculture'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token string"&gt;so then it wouldn't match the right values unfortunately.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 15:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Matching-Data/m-p/587265#M14653</guid>
      <dc:creator>Jens89</dc:creator>
      <dc:date>2019-09-09T15:07:53Z</dc:date>
    </item>
  </channel>
</rss>

