<?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: dataset name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345471#M273139</link>
    <description>&lt;P&gt;Agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15174"&gt;@Peter_C&lt;/a&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2017 17:30:01 GMT</pubDate>
    <dc:creator>collinelliot</dc:creator>
    <dc:date>2017-03-29T17:30:01Z</dc:date>
    <item>
      <title>dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345449#M273135</link>
      <description>&lt;P&gt;I need add labels to many datasets. I can get these labels from datasets present in different library. can anyone help me regarding this?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 16:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345449#M273135</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2017-03-29T16:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345467#M273136</link>
      <description>&lt;P&gt;You can use the sashelp.vcolumn data to pull the label information from one data set into a macro variable that you apply to both.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The particular details of your data will depend on how similar the data truly are, but an example of doing this is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
SELECT catx('=', name, quote(strip(label))) INTO :applyLabels SEPARATED BY ' '
FROM sashelp.vcolumn
WHERE libname = 'SASHELP' AND
              memname = 'CLASS';
quit;

data want;
set have;
label &amp;amp;applyLabels;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:23:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345467#M273136</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-29T17:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345468#M273137</link>
      <description>&lt;P&gt;Note that this is a terrible example because sashelp.class does not have any labels on its variables, but you'll be replacing 'SASHELP' and 'CLASS' with a data set that in theory does have labels...&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345468#M273137</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-29T17:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345470#M273138</link>
      <description>&lt;P&gt;rather than apply these labels in a data step which rewrites the whole data, use the same label statement in&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC DATASETS library= yourLib nolist ;
   modify your_data_set ;
  &amp;nbsp;  label &amp;amp;applyLabels ;
   run ;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345470#M273138</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2017-03-29T17:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345471#M273139</link>
      <description>&lt;P&gt;Agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15174"&gt;@Peter_C&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:30:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345471#M273139</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-29T17:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345472#M273140</link>
      <description>you should be able to engineer a loop generating the  modify+label statements for each target table in each library  that needs labelling</description>
      <pubDate>Wed, 29 Mar 2017 17:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345472#M273140</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2017-03-29T17:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345480#M273141</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;If i use label statemt in datastep, it will search for variable and then apply label. howevr, we are more looking to get labels for dataset.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:45:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345480#M273141</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2017-03-29T17:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345484#M273142</link>
      <description>&lt;P&gt;I'm not sure I follow. What I think you have is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data_no_labels&lt;/P&gt;&lt;P&gt;data_yes_labels&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where the variables are the same (or at least many are, but the code can be adapted to account for only common variables).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You want to use the sql code to pull the label information from "data_yes_labels" and then apply it to data_no_labels using the proc data sets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that not correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As Peter said, if you have do this with a lot, you can generate some kind of a loop or possible write a macro. But without more details, it's hard to say. But first, is my description not correct?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 17:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345484#M273142</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-29T17:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345526#M273143</link>
      <description>&lt;P&gt;Proc datasets can be used to change or add dataset labels as well. e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;PROC DATASETS library= work nolist ;
  modify datasetname(label='Label for Data Set');
run ;
&lt;/PRE&gt;
&lt;P&gt;The question is how you have the two sets of datasetnames (i.e., the one with the labels and those that don't have labels or labels that you want to change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a file that includes both, it would be easy to wrap the above code into a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 20:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345526#M273143</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-29T20:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345541#M273144</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to label datasets not variables...but I kind of used similar approach you and peter mentioned. I got the labels for my datasets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanka a lot..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 21:01:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345541#M273144</guid>
      <dc:creator>petlove</dc:creator>
      <dc:date>2017-03-29T21:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: dataset name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345542#M273145</link>
      <description>&lt;P&gt;Do you mean you want to assign labels to variables in a data set using the labels that another dataset has assigned for the same variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the data sets are exactly the same: number, name and type of varibles this may be the easiest way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data mydata;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OTHLIB.Data(obs=0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mydata&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where OTHLIB.Data is the library and data set of the one you want to pull labels from (this will also get Formats and Informats),&lt;/P&gt;
&lt;P&gt;and Mydata is the data set you want to have those attributes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a large number of sets to do this with better would be to get the bits you need from Dictionary.Columns or sashelp.vcolumn&amp;nbsp;and use that information to call Proc Datasets to modify the data sets.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 21:02:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dataset-name/m-p/345542#M273145</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-29T21:02:01Z</dc:date>
    </item>
  </channel>
</rss>

