<?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 Can we label variables when we do select * in proc sql? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-label-variables-when-we-do-select-in-proc-sql/m-p/430245#M68597</link>
    <description>&lt;P&gt;For instance, after a variable, we can put label = '~' to label a variable. Can we label variables with * instead of typing out all the variables and putting label = ' ~~ '&amp;nbsp; next to each?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;Title 'a) All Rows and Columns Without Labels';&lt;BR /&gt;&amp;nbsp; &amp;nbsp;SELECT *&amp;nbsp; &amp;nbsp;&amp;lt;- After putting SELECT * instead of listing all the variables: is there an easier way to label each variable?&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;FROM directory.dataset;&lt;/P&gt;&lt;P&gt;QUIT;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 01:40:02 GMT</pubDate>
    <dc:creator>gsk</dc:creator>
    <dc:date>2018-01-24T01:40:02Z</dc:date>
    <item>
      <title>Can we label variables when we do select * in proc sql?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-label-variables-when-we-do-select-in-proc-sql/m-p/430245#M68597</link>
      <description>&lt;P&gt;For instance, after a variable, we can put label = '~' to label a variable. Can we label variables with * instead of typing out all the variables and putting label = ' ~~ '&amp;nbsp; next to each?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;Title 'a) All Rows and Columns Without Labels';&lt;BR /&gt;&amp;nbsp; &amp;nbsp;SELECT *&amp;nbsp; &amp;nbsp;&amp;lt;- After putting SELECT * instead of listing all the variables: is there an easier way to label each variable?&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;FROM directory.dataset;&lt;/P&gt;&lt;P&gt;QUIT;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 01:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-label-variables-when-we-do-select-in-proc-sql/m-p/430245#M68597</guid>
      <dc:creator>gsk</dc:creator>
      <dc:date>2018-01-24T01:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can we label variables when we do select * in proc sql?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-label-variables-when-we-do-select-in-proc-sql/m-p/430247#M68598</link>
      <description>&lt;P&gt;No, I don’t think you can, for starters how would the compiler know which variables to label.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a data set with the mapping of variables to labels you can do an automated labelling process.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you’re using * because you’re too lazy to list them all, a perfectly valid reason, use the FEEDBACK option in the PROC SQL statement and check the log. It will have the full code with appropriate alias and you can modify it as necessary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also add labels after the fact using PROC DATASETS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 01:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-label-variables-when-we-do-select-in-proc-sql/m-p/430247#M68598</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-24T01:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can we label variables when we do select * in proc sql?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-we-label-variables-when-we-do-select-in-proc-sql/m-p/430325#M68600</link>
      <description>&lt;P&gt;No, you can't label variables when selecting all.&amp;nbsp; Its rarely a good idea to use the * anyways, it can cause issues, and will definately make you sql take longer to run and use more disk space.&amp;nbsp; I would always use explicit definitions of what you want to select, from where, and what specific data, not only does this make the code nice an transparent, but as quick as it can be.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 09:31:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-we-label-variables-when-we-do-select-in-proc-sql/m-p/430325#M68600</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-24T09:31:34Z</dc:date>
    </item>
  </channel>
</rss>

