<?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 VLABEL Question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80190#M23076</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to transfer the variables lables from the X's to the Y's. here is how i think i should be able to do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input x1 x2 x3 y1 y2 y3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; label x1 = Var1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x2 = Var2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x3 = Var3;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 2 3 4 5 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array x {*} x1-x3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array y {*} y1-y3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to dim(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y{i} = x(vlabel(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Apr 2012 18:25:13 GMT</pubDate>
    <dc:creator>SAShole</dc:creator>
    <dc:date>2012-04-11T18:25:13Z</dc:date>
    <item>
      <title>VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80190#M23076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to transfer the variables lables from the X's to the Y's. here is how i think i should be able to do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input x1 x2 x3 y1 y2 y3;&lt;/P&gt;&lt;P&gt;&amp;nbsp; label x1 = Var1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x2 = Var2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x3 = Var3;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1 2 3 4 5 6&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array x {*} x1-x3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array y {*} y1-y3;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to dim(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y{i} = x(vlabel(i));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 18:25:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80190#M23076</guid>
      <dc:creator>SAShole</dc:creator>
      <dc:date>2012-04-11T18:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80191#M23077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shouldn't the final assignment be rearranged?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;y{i} = vlabel(x{i});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 18:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80191#M23077</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-04-11T18:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80192#M23078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks astounding.&lt;/P&gt;&lt;P&gt;this also made me realize that what i really want is to assign the x array labels to the y array.&lt;/P&gt;&lt;P&gt;such that:&lt;/P&gt;&lt;P&gt;label y{i} = vlabel(x{i})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i dont get the desired result.&lt;/P&gt;&lt;P&gt;any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 18:51:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80192#M23078</guid>
      <dc:creator>SAShole</dc:creator>
      <dc:date>2012-04-11T18:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80193#M23079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nothing simple, and nothing pretty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess I would use CALL EXECUTE in that DATA step to generate the proper PROC DATASETS statements to assign labels.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In real life, does the data set already exist in SAS form (and you need to change the labels)?&amp;nbsp; Or are you really inputting from raw data?&amp;nbsp; I guess my approach could work either way, but it does get messy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 19:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80193#M23079</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-04-11T19:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80194#M23080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let SAS do it for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; have(obs=0 rename=(x1-x2=y1-y2) drop=y1-y2)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; have&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 19:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80194#M23080</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-04-11T19:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80195#M23081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yea i have a SAS dataset with about 100 variables, each with a label.&lt;/P&gt;&lt;P&gt;the variables are named in this fashion, BP1-BP100.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 19:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80195#M23081</guid>
      <dc:creator>SAShole</dc:creator>
      <dc:date>2012-04-11T19:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80196#M23082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice, simple, and practical. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Complications to watch for.&amp;nbsp; When there are conflicting variable attributes assigned, the FORMAT attribute is taken from the first data set, but the LABEL and INFORMAT attributes are taken from the second data set.&amp;nbsp; So if the Y variables already have labels that you need to change, you'll have to switch the order of the "have" references.&amp;nbsp; Of course, that wasn't part of the original problem, and this is a great solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 20:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80196#M23082</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-04-11T20:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80197#M23083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 20:22:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80197#M23083</guid>
      <dc:creator>SAShole</dc:creator>
      <dc:date>2012-04-11T20:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80198#M23084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;Complications to watch for.&amp;nbsp; When there are conflicting variable attributes assigned, the FORMAT attribute is taken from the first data set, but the LABEL and INFORMAT attributes are taken from the second data set.&amp;nbsp; So if the Y variables already have labels that you need to change, you'll have to switch the order of the "have" references.&amp;nbsp; Of course, that wasn't part of the original problem, and this is a great solution.&lt;/P&gt;
 &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to keep the FORMATS and/or INFORMATS that is doable with to a little more code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; x1 x2 x3 y1 y2 y3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;label&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; x1 = Var1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x2 = Var2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x3 = Var3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; x1-x3 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: 'Courier New';"&gt;dollar12.2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; y1-y3 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: 'Courier New';"&gt;comma12.3&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;informat&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; x1-x3 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: 'Courier New';"&gt;F12.2&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;informat&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; y1-y3 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: 'Courier New';"&gt;D12.3&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: #ffffc0; color: black; font-family: 'Courier New';"&gt;1 2 3 4 5 6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; want;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt; &lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; have; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: green; font-family: 'Courier New';"&gt;*keep varnum order;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt; &lt;STRONG style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; have(keep=x: rename=(x1-x3=y1-y3)); &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: green; font-family: 'Courier New';"&gt;*copy attributes;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; _all_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;informat&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; _all_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;contents&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;varnum&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;label&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 21:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80198#M23084</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-04-11T21:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80199#M23085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wanted to offer a simple approach:=&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents OUT= provides a dataset with the labels as data you can use simply to generate a LABEL statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let data1 = data_with_labels;&lt;/P&gt;&lt;P&gt;%let data2 = data_without ;&lt;/P&gt;&lt;P&gt;%let lib= %scan( work.&amp;amp;data2, -2, . ) ;&amp;nbsp; * get libname for target or work ;&lt;/P&gt;&lt;P&gt;%let toMem = %scan( &amp;amp;data2, -1, . ) ;&amp;nbsp; * get memname of target ;&lt;/P&gt;&lt;P&gt;proc contents data= &amp;amp;data1 noprint out= conts1 ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;(and then I thought about the possibility that there might be more variables in the label source than the unlabelled target!&lt;/P&gt;&lt;P&gt;So an sql join came into it because the names might not have the same "caSe"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data= &amp;amp;data2 noprint out= conts2 ;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;proc sql ;&lt;/P&gt;&lt;P&gt; create table new_labels4old&amp;nbsp; as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select b.name, a.label&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp; conts1 as A , conts2 as B&lt;/P&gt;&lt;P&gt; where upcase(a.name) = upcase(b.name) and a.label ne ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let cont1 = &amp;amp;syslast ;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;call execute( 'proc datasets library= "&amp;amp;lib" nolist mt= data; ') ;&lt;/P&gt;&lt;P&gt;call execute( ' modify &amp;amp;toMem; ' ) ;&lt;/P&gt;&lt;P&gt;do while( not end_of_data ) ;&lt;/P&gt;&lt;P&gt;set new_labels4old end= end_of_data&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;call execute( name !! '=' !! quote(trim( label))&amp;nbsp; ) ;&lt;/P&gt;&lt;P&gt;end ;&lt;/P&gt;&lt;P&gt;call execute( '; run; quit; ' );&lt;/P&gt;&lt;P&gt;stop;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(so it stopped looking so "simple") &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 22:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80199#M23085</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2012-04-11T22:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: VLABEL Question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80200#M23086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;data have;
input x1 x2 x3 y1 y2 y3;
&amp;nbsp; label x1 = Var1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x2 = Var2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x3 = Var3;
cards;
1 2 3 4 5 6
;
run;
data _null_;
 set sashelp.vcolumn(keep=libname memname name label where=(libname='WORK' and memname='HAVE' and name like 'x%')) end=last;
 if _n_ eq 1 then call execute('proc datasets library=work nolist;modify have; label ');
 call execute(catx(' ',translate(name,'y','x'),'="',label,'"',name,'=" "'));
 if last then call execute(';quit;');
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 04:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/VLABEL-Question/m-p/80200#M23086</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-04-12T04:44:10Z</dc:date>
    </item>
  </channel>
</rss>

