<?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: Can you query the Information Map in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/367741#M484</link>
    <description>&lt;P&gt;Surprisingly, it seems to be supported, at least in theory:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/engimap/65021/HTML/default/viewer.htm#n0s8b09ivok68nn1md3wqemknxj5.htm" target="_self"&gt;Using the SAS Information Maps LIBNAME Engine&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="xis-code"&gt; libname mymaps infomaps metauser=myUserID
                         metapass=myPassword
                         metaserver="myserver.mycompany.com"
                         metaport=8561
                         mappath="/Users/myUserID/My Folder";&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not aware though of anyone who has done that, so would love to hear of your use case and experience doing it this way.&lt;BR /&gt;&lt;BR /&gt;Would you share?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jun 2017 14:37:18 GMT</pubDate>
    <dc:creator>Dmitry_Alergant</dc:creator>
    <dc:date>2017-06-16T14:37:18Z</dc:date>
    <item>
      <title>Can you query the Information Map</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/367730#M483</link>
      <description>&lt;P&gt;Is it possible to query the Information Map with PROC SQL?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to have a script where I can verify a field has been added and query it to ensure the relationship is set right or that there are no unexpected duplicates in other tables.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 14:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/367730#M483</guid>
      <dc:creator>pcapazzi</dc:creator>
      <dc:date>2017-06-16T14:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can you query the Information Map</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/367741#M484</link>
      <description>&lt;P&gt;Surprisingly, it seems to be supported, at least in theory:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/engimap/65021/HTML/default/viewer.htm#n0s8b09ivok68nn1md3wqemknxj5.htm" target="_self"&gt;Using the SAS Information Maps LIBNAME Engine&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="xis-code"&gt; libname mymaps infomaps metauser=myUserID
                         metapass=myPassword
                         metaserver="myserver.mycompany.com"
                         metaport=8561
                         mappath="/Users/myUserID/My Folder";&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not aware though of anyone who has done that, so would love to hear of your use case and experience doing it this way.&lt;BR /&gt;&lt;BR /&gt;Would you share?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 14:37:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/367741#M484</guid>
      <dc:creator>Dmitry_Alergant</dc:creator>
      <dc:date>2017-06-16T14:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can you query the Information Map</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/367841#M486</link>
      <description>&lt;P&gt;Thanks! You got me going in the right direction.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am able to get details of the current information map and can store it and compare when changes I request are made.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*&lt;BR /&gt;proc infomaps &lt;BR /&gt; metauser="user id"&lt;BR /&gt; metapass="password"&lt;BR /&gt; metaserver="server"&lt;BR /&gt; metaport=8561;&lt;BR /&gt;update infomap mapname&lt;BR /&gt; mappath="/path to where the map is located/"&lt;BR /&gt; verify=no; **don't verify sources&lt;BR /&gt;list _all_; **list everything&lt;BR /&gt;*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This shows the results in a log. There is an XML export function which I can explore.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But what I really was happy to see was using proc sql worked out as expected:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname mymaps infomaps metauser=userid&lt;BR /&gt; metapass=password&lt;BR /&gt; metaserver="server"&lt;BR /&gt; metaport=8561&lt;BR /&gt; mappath="/path to infomap/";&lt;/P&gt;
&lt;P&gt;proc datasets lib=mymaps; **libname for this path&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;option validvarname=any; **case insensitive&lt;/P&gt;
&lt;P&gt;proc contents data=mymaps.mapname; **put in the campaign map name&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sql ; **run a query against a data item and compare results to your source.&amp;nbsp;&lt;BR /&gt;select count(*)&lt;BR /&gt;from mymaps.CampaignMap&lt;BR /&gt;where 'Postal Cd'n='33065'; &amp;nbsp;**for field names with spaces enclose them in single quotes with an n afterwards.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Worked like a charm!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jun 2017 18:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/367841#M486</guid>
      <dc:creator>pcapazzi</dc:creator>
      <dc:date>2017-06-16T18:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can you query the Information Map</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/370092#M496</link>
      <description>&lt;P&gt;So this is how I went about it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I first retreived a list of all objects in the information map. I only needed Data Items for what I'm doing so I could change the _all_ to dataitems next time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc infomaps &lt;BR /&gt; metauser="user id"&lt;BR /&gt; metapass="password"&lt;BR /&gt; metaserver="server"&lt;BR /&gt; metaport=8561;&lt;BR /&gt;update infomap mapname&lt;BR /&gt; mappath="/path to where the map is located/"&lt;BR /&gt; verify=no; **don't verify sources&lt;BR /&gt;list _all_; **list everything&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result of the above shows up in the log in Enterprise Guide. I highlight and copy it all and paste it into Excel. I insert a column to the left of the log results and auto-fill it asending to keep the row order. I then sort and/or filter by the log column to get rid of spaces and page headings the log produces. I resort (if necessary) by the row number column on the left.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I copy the contents of the log column and paste it as values into a new sheet. In the column to the right I use a trim statement for the log on the left to get rid of leading/trailing spaces. I then copy the trim column and replace the first column as Values only. If you used list _all_ and want to only get the fields you want to work with you should purge rows above and below Data Items (Data Sources, Relationships, etc.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Data Items there are 8 fields so I made 8 columns to the right.&lt;/P&gt;
&lt;TABLE width="512" style="width: 384pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL width="64" style="width: 48pt;" span="8" /&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD width="64" height="20" style="border: 0px black; border-image: none; width: 48pt; height: 15pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Data item name:&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;ID:&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Folder:&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Description:&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Expression:&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Expression type:&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Classification:&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="64" style="border: 0px black; border-image: none; width: 48pt; background-color: transparent;"&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Format:&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The structure is consistent all the way through the Data Items I used some string maniuplation to populate cells relative to the Data Item Name:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first cell under the newly added Data Item Name column looks at the log line and if it starts with Data item name then pull everything after "Data item name:" (the length of the phrase with a space after is 16)&lt;/P&gt;
&lt;P&gt;=IF(LEFT($B2,15)="Data item name:",RIGHT(B2,LEN(B2)-16),"")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The next column will have ID: and that will have a very similar formula but will look at the next row for its data:&lt;/P&gt;
&lt;P&gt;=IF(LEFT($B2,15)="Data item name:",RIGHT(B3,LEN(B3)-4),"")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Continue the pattern for the others:&lt;/P&gt;
&lt;P&gt;=IF(LEFT($B2,15)="Data item name:",RIGHT(B4,LEN(B4)-8),"")&lt;/P&gt;
&lt;P&gt;=IF(LEFT($B2,15)="Data item name:",RIGHT(B5,LEN(B5)-13),"")&lt;/P&gt;
&lt;P&gt;=IF(LEFT($B2,15)="Data item name:",RIGHT($B6,LEN($B6)-12),"")&lt;/P&gt;
&lt;P&gt;=IF(LEFT($B2,15)="Data item name:",RIGHT($B7,LEN($B7)-17),"")&lt;/P&gt;
&lt;P&gt;=IF(LEFT($B2,15)="Data item name:",RIGHT($B8,LEN($B8)-16),"")&lt;/P&gt;
&lt;P&gt;=IF(LEFT($B2,15)="Data item name:",RIGHT($B9,LEN($B9)-8),"")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Copy this row all they down. I then copied the three columns to a new sheet and filtered for blanks and removed them. Then unfiltered the list and I am left with all of the data items that I can search through.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my case I filtered for the table I know the infomap has recently been connected to and get the IDs of the fields. I can then query them. I create a temporary work table to help with performance:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;SQL&lt;/FONT&gt;&lt;/STRONG&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;CREATE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TABLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; WORK.PC_MAIL_OUT_TEST &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;AS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; (&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;SELECT&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Address Line 1_2'N&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'Address Line 2_2'N&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;etc.. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&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;Then I can query my temporary table:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&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;select&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;'Postal Cd_10'N&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;, count(*)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; work.&lt;FONT face="Courier New"&gt;PC_MAIL_OUT_TEST &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;group&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;order&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;by&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&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;I can also compare results of that against the database by using/creating a libref to the source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you find this helpful. It was a fun exercise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 19:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/370092#M496</guid>
      <dc:creator>pcapazzi</dc:creator>
      <dc:date>2017-06-23T19:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can you query the Information Map</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/370478#M501</link>
      <description>&lt;P&gt;Makes sense, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 10:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/Can-you-query-the-Information-Map/m-p/370478#M501</guid>
      <dc:creator>Dmitry_Alergant</dc:creator>
      <dc:date>2017-06-26T10:52:59Z</dc:date>
    </item>
  </channel>
</rss>

