<?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: Tip: Global Data Sources in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Tip-Global-Data-Sources/m-p/192899#M2445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was just talking to a colleague about global data sources. We came up with the example below. More information available in the SAS Enterprise Miner Reference Help, in the section Enterprise Miner Data Sources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Here an example that I hope helps you save some time getting started with Global Data Sources.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt;1. &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Base SAS quick-and-dirty way to generate a generic metadata table.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;STRONG&gt;Explanation&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The path from mydata library (e.g. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'D:\My Publications\SGF2012'&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;) is the path where your data is happily stored.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The path for EMGDS library (e.g.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt; 'D:\All_Users\miguel'&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; ) is the path where you will put all your Global Metadata data sets from now on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;The &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/* create EM macros */&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; section loads the EMDS macro so that you can get a metadata table in no time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;In the call for the &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;EMDS&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; macro you will change &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;mydata.data_orlando &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;for a data set that you use a lot. If you don’t have any data set in mind, feel free to run it for any dataset e.g. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;EMDS&lt;/EM&gt;&lt;/STRONG&gt;(data=sashelp.cars)&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;. This will expedite things for step 2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;In Base SAS run the below (you could run it in SAS Enterprise Miner too but it helps to do it in base SAS for step 2):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/* libname for global data source location */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; mydata &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'D:\My Publications\SGF2012'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; EMGDS &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'D:\All_Users\miguel'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/* create EM macros */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; code &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;catalog&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'sashelp.emutil.emds.source'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%include&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; code;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;/P&gt;&lt;P style="margin-left: 1.5in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;EMDS&lt;/EM&gt;&lt;/STRONG&gt;(data=mydata.data_orlando)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;After running this code, notice that the EMDS macro created three tables for you. The one you care about has a _&lt;EM&gt;cm &lt;/EM&gt;suffix&lt;EM&gt;. &lt;/EM&gt;For example, I ran this for mydata.data_orlando and the table I want is Dataorlando_cm. Feel free to delete the other two data sets.&lt;/SPAN&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG __jive_id="6132" alt="p1.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/6132_p1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt;2. &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Modify the metadata table.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;You can just double click on it to modify it or you can use code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;Let’s say you are interested in the variable Loan_Default. It should always be a binary target.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;One option to do that is to use the Edit mode in base SAS (highlighted red box below). I typed the Role and Level column as below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;IMG alt="p2.png" class="jive-image-thumbnail jive-image" height="87" src="https://communities.sas.com/legacyfs/online/6145_p2.png" style="height: 87px; width: 1151.4705882352941px;" width="1151" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;Another option is to use code. Since the columns have been defined, it is way easier than starting from scratch.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;For example, you can also run in base SAS:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; EMGDS.miguelsEMGDS;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; EMGDS.dataorlando_cm;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; name=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"Loan_Default"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Role=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"TARGET"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Level=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"BINARY"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: .5in;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Since you are only interested in the variable named “Loan_Default” feel free to delete the table &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;EMGDS.dataorlando_cm&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;. Also add any other variables that you use frequently across many projects.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;Once you have defined all the metadata options for the variables you need, go to Enterprise Miner.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt;3. &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Specify the location of a EMGDS library in Enterprise Miner.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;In the project startcode define an EMGDS library with the path to the table you have just created. In my example, I copied this line from the first code (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; EMGDS &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'D:\All_Users\miguel'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG __jive_id="6135" alt="p3.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6135_p3.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;After these 3 steps you are good to go!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Any time you include a variable called Loan_Amount, SAS Enterprise Miner will set it as a binary target, as per the definitions in the Enterprise Miner Global Data Set (EMGDS) library.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I hope it helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Miguel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Apr 2014 20:22:52 GMT</pubDate>
    <dc:creator>M_Maldonado</dc:creator>
    <dc:date>2014-04-24T20:22:52Z</dc:date>
    <item>
      <title>Tip: Global Data Sources</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Tip-Global-Data-Sources/m-p/192898#M2444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 12pt;"&gt;Did you know that you can use your global data sources to specify metadata that can be used across multiple users, diagrams, and projects?&amp;nbsp; This is ideal if there are data sources that you use regularly as you no longer have to redefine that metadata over and over again. As outlined in the documentation, the key is to use a libname statment with the libref EMGDS.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Mar 2014 18:07:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Tip-Global-Data-Sources/m-p/192898#M2444</guid>
      <dc:creator>lryan</dc:creator>
      <dc:date>2014-03-05T18:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: Tip: Global Data Sources</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Tip-Global-Data-Sources/m-p/192899#M2445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was just talking to a colleague about global data sources. We came up with the example below. More information available in the SAS Enterprise Miner Reference Help, in the section Enterprise Miner Data Sources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Here an example that I hope helps you save some time getting started with Global Data Sources.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt;1. &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Base SAS quick-and-dirty way to generate a generic metadata table.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;STRONG&gt;Explanation&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The path from mydata library (e.g. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'D:\My Publications\SGF2012'&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;) is the path where your data is happily stored.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The path for EMGDS library (e.g.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt; 'D:\All_Users\miguel'&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; ) is the path where you will put all your Global Metadata data sets from now on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="text-indent: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;The &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/* create EM macros */&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; section loads the EMDS macro so that you can get a metadata table in no time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;In the call for the &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;EMDS&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt; macro you will change &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;mydata.data_orlando &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;for a data set that you use a lot. If you don’t have any data set in mind, feel free to run it for any dataset e.g. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;EMDS&lt;/EM&gt;&lt;/STRONG&gt;(data=sashelp.cars)&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;. This will expedite things for step 2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;In Base SAS run the below (you could run it in SAS Enterprise Miner too but it helps to do it in base SAS for step 2):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/* libname for global data source location */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; mydata &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'D:\My Publications\SGF2012'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; EMGDS &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'D:\All_Users\miguel'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;/* create EM macros */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; code &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;catalog&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'sashelp.emutil.emds.source'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%include&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; code;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;/P&gt;&lt;P style="margin-left: 1.5in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;EMDS&lt;/EM&gt;&lt;/STRONG&gt;(data=mydata.data_orlando)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;After running this code, notice that the EMDS macro created three tables for you. The one you care about has a _&lt;EM&gt;cm &lt;/EM&gt;suffix&lt;EM&gt;. &lt;/EM&gt;For example, I ran this for mydata.data_orlando and the table I want is Dataorlando_cm. Feel free to delete the other two data sets.&lt;/SPAN&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG __jive_id="6132" alt="p1.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/6132_p1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt;2. &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Modify the metadata table.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;You can just double click on it to modify it or you can use code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;Let’s say you are interested in the variable Loan_Default. It should always be a binary target.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;One option to do that is to use the Edit mode in base SAS (highlighted red box below). I typed the Role and Level column as below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;IMG alt="p2.png" class="jive-image-thumbnail jive-image" height="87" src="https://communities.sas.com/legacyfs/online/6145_p2.png" style="height: 87px; width: 1151.4705882352941px;" width="1151" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;Another option is to use code. Since the columns have been defined, it is way easier than starting from scratch.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;For example, you can also run in base SAS:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; EMGDS.miguelsEMGDS;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; EMGDS.dataorlando_cm;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; name=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"Loan_Default"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Role=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"TARGET"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1.0in;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Level=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"BINARY"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in; text-indent: .5in;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Since you are only interested in the variable named “Loan_Default” feel free to delete the table &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;EMGDS.dataorlando_cm&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;. Also add any other variables that you use frequently across many projects.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;Once you have defined all the metadata options for the variables you need, go to Enterprise Miner.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #1f497d;"&gt;3. &lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;Specify the location of a EMGDS library in Enterprise Miner.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&lt;SPAN style="color: #1f497d;"&gt;In the project startcode define an EMGDS library with the path to the table you have just created. In my example, I copied this line from the first code (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;libname&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; EMGDS &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'D:\All_Users\miguel'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="color: #1f497d;"&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: .5in;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG __jive_id="6135" alt="p3.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6135_p3.png" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;After these 3 steps you are good to go!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Any time you include a variable called Loan_Amount, SAS Enterprise Miner will set it as a binary target, as per the definitions in the Enterprise Miner Global Data Set (EMGDS) library.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I hope it helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Miguel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Apr 2014 20:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Tip-Global-Data-Sources/m-p/192899#M2445</guid>
      <dc:creator>M_Maldonado</dc:creator>
      <dc:date>2014-04-24T20:22:52Z</dc:date>
    </item>
  </channel>
</rss>

