<?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: How to add (500) multiple user-id's to SAS Metadata server . in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631788#M18458</link>
    <description>&lt;P&gt;This seems to be way over your head, get help from a consultant.&lt;/P&gt;
&lt;P&gt;We can't provide help for this without sitting in front of your terminal/desktop, and that would mean a consultancy.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2020 06:30:55 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-03-13T06:30:55Z</dc:date>
    <item>
      <title>How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631414#M18444</link>
      <description>&lt;P&gt;How to add (500) multiple user-id's to SAS Metadata server .&lt;/P&gt;&lt;P&gt;please provide me sample sas code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If multiple sas users on notepad list ,how to add into metadata SAS server.&lt;/P&gt;&lt;P&gt;For this need sas code ,please help me support on this issue .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Libname testar /var/userdata/testusers.txt ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;testusers.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;john&lt;/P&gt;&lt;P&gt;david&lt;/P&gt;&lt;P&gt;kumar&lt;/P&gt;&lt;P&gt;praveen&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 23:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631414#M18444</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-11T23:07:45Z</dc:date>
    </item>
    <item>
      <title>How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631417#M18446</link>
      <description>&lt;P&gt;How to add (500) multiple user-id's to SAS Metadata server .&lt;/P&gt;&lt;P&gt;please provide me sample sas code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If multiple sas users on notepad list ,how to add into metadata SAS server.&lt;/P&gt;&lt;P&gt;For this need sas code ,please help me support on this issue .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Libname testar /var/userdata/testusers.txt ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;testusers.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;john&lt;/P&gt;&lt;P&gt;david&lt;/P&gt;&lt;P&gt;kumar&lt;/P&gt;&lt;P&gt;praveen&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2020 23:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631417#M18446</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-11T23:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631432#M18447</link>
      <description>&lt;P&gt;SAS provides a collection of macros for synchronisation of AD/LDAP with SAS Metadata. These macros should give you a good starting point to come-up with code that uses a .txt file as source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Documentation &lt;A href="https://go.documentation.sas.com/?docsetId=bisecag&amp;amp;docsetTarget=p02wesbzrochnbn1na7fqdy2gdvo.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And my way to find the physical location of these macros quickly:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mautolocdisplay obs=0;
%MDUCHGLB();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Calling above macro without parameters will throw an error - but it prints to the SAS log where the macro resides on disk.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure you backup SAS Metadata before you execute anything that actually modifies metadata.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure where you're at with SAS expertise but please note that implementing scripts to modify SAS Metadata is not a beginners task and that you can severely corrupt metadata and bring a SAS environment down if you get it wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please ask the same question only in one forum only. May I suggest you delete the duplicate &lt;A href="https://communities.sas.com/t5/Community-Matters/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631414#M4234" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 03:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631432#M18447</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-12T03:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631437#M18445</link>
      <description>&lt;P&gt;This question is a duplicate from &lt;A href="https://communities.sas.com/t5/forums/editpage/board-id/new-users/message-id/20920" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 03:05:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631437#M18445</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-12T03:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631438#M18448</link>
      <description>There is a whole lot of detail along with hyperlinks to sample code listed here - &lt;A href="http://support.sas.com/kb/40/628.html" target="_blank"&gt;http://support.sas.com/kb/40/628.html&lt;/A&gt;</description>
      <pubDate>Thu, 12 Mar 2020 03:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631438#M18448</guid>
      <dc:creator>AnandVyas</dc:creator>
      <dc:date>2020-03-12T03:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631445#M18449</link>
      <description>Thank you for solution ..Patrick.&lt;BR /&gt;but i dont know how to use this macro ,can you provide me code for this example .</description>
      <pubDate>Thu, 12 Mar 2020 04:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631445#M18449</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-12T04:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631446#M18450</link>
      <description>Thank you ..Anand</description>
      <pubDate>Thu, 12 Mar 2020 04:28:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631446#M18450</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-12T04:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631450#M18451</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This question is a duplicate from &lt;A href="https://communities.sas.com/t5/forums/editpage/board-id/new-users/message-id/20920" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I merged the double-post.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 05:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631450#M18451</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-12T05:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631451#M18452</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/157476"&gt;@a_SAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you for solution ..Patrick.&lt;BR /&gt;but i dont know how to use this macro ,can you provide me code for this example .&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I've already provided you the link to the documentation and I've also shown you how you can easily figure out the physical path to the macro code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm asking myself though what good it will do to you to just add 500+ metadata users without any group assignment and external users.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where do you get this list from? If it's an extract from AD/LDAP then consider to sync directly from there (and how that's done is documented under the link I've shared).&lt;/P&gt;
&lt;P&gt;If you want to use a text file as input then I guess you just need to investigate the existing macros and figure out how to prepare a source data set which you then can pass into one of the existing macros (ideally without having to change the macro code itself).&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 05:27:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631451#M18452</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-12T05:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631491#M18453</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/157476"&gt;@a_SAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you for solution ..Patrick.&lt;BR /&gt;but i dont know how to use this macro ,can you provide me code for this example .&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Look where your SAS is installed. In&lt;/P&gt;
&lt;PRE&gt;/path_to_sas/SASFoundation/9.4/samples/base&lt;/PRE&gt;
&lt;P&gt;you find a program called importpw.sas. This program syncs the UNIX passwd and group files with SAS metadata. You can use it as a blueprint for your own process; you need to provide a base that contains names, unique ID's, host user names (used when logging on), and group membership.&lt;/P&gt;
&lt;P&gt;The code is pretty much self-explaining, it uses comments liberally to explain what it does. OTOH, it also shows the relative complexity of the task; if it proves to be overwhelming for you, you should seriously consider seeking consultancy from a pro (your local SAS office can provide such).&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 09:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631491#M18453</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-12T09:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631736#M18454</link>
      <description>Hi!KurtBremser&lt;BR /&gt;&lt;BR /&gt;If our sas users user-id is source location for this path /home&lt;BR /&gt;&lt;BR /&gt;How will import user-id’s to SAS metadata server . I am trying to use similar this code “importpw.sas” and have some doubts ,is it support this code update in SAS Metadata .&lt;BR /&gt;Please can you verify attached code some of parameters updated based on user-id source location path.&lt;BR /&gt;&lt;BR /&gt;Please suggest me any thing need to update on code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I used sample code from below path&lt;BR /&gt;&lt;BR /&gt;/sasdev01/sascomp/sashome/SASFoundation/9.4/samples/base/ importpw.sas&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/home location users user-id source location path&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[sasadmin@adisas003 home]$ pwd&lt;BR /&gt;&lt;BR /&gt;/home&lt;BR /&gt;&lt;BR /&gt;drwx------ 2 kumar kumar 4096 Mar 12 04:31 kumar&lt;BR /&gt;drwxr-xr-x 38 david david 24576 Mar 12 05:00 david&lt;BR /&gt;drwxr-xr-x 21 john john 12288 Mar 12 06:13 john</description>
      <pubDate>Thu, 12 Mar 2020 23:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631736#M18454</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-12T23:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631737#M18455</link>
      <description>Hi Patrick&lt;BR /&gt;&lt;BR /&gt;If our sas users user-id is source location for this path /home&lt;BR /&gt;&lt;BR /&gt;How will import user-id’s to SAS metadata server . I am trying to use similar this code “importpw.sas” and have some doubts ,is it support this code update in SAS Metadata .&lt;BR /&gt;Please can you verify attached code some of parameters updated based on user-id source location path.&lt;BR /&gt;&lt;BR /&gt;Please suggest me any thing need to update on code.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I used sample code from below path&lt;BR /&gt;&lt;BR /&gt;/sasdev01/sascomp/sashome/SASFoundation/9.4/samples/base/ importpw.sas&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/home location users user-id source location path&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;[sasadmin@adisas003 home]$ pwd&lt;BR /&gt;&lt;BR /&gt;/home&lt;BR /&gt;&lt;BR /&gt;drwx------ 2 kumar kumar 4096 Mar 12 04:31 kumar&lt;BR /&gt;drwxr-xr-x 38 david david 24576 Mar 12 05:00 david&lt;BR /&gt;drwxr-xr-x 21 john john 12288 Mar 12 06:13 john</description>
      <pubDate>Thu, 12 Mar 2020 23:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631737#M18455</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-12T23:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631740#M18456</link>
      <description>&lt;P&gt;/****************************************************************************&lt;BR /&gt;* S A S S A M P L E L I B R A R Y&lt;BR /&gt;*&lt;BR /&gt;* NAME: IMPORTPW&lt;BR /&gt;* TITLE: Metadata User Import From etc/passwd file&lt;BR /&gt;* PRODUCT: SAS&lt;BR /&gt;* VERSION: 9.1&lt;BR /&gt;* SYSTEM: ALL&lt;BR /&gt;* DATE: 16DEC2003&lt;BR /&gt;* DESC: Example code to extract user information from&lt;BR /&gt;* Unix etc/passwd and group files and load it into&lt;BR /&gt;* the Metadata Server.&lt;BR /&gt;* KEYS: METADATA USER PERSON IDENTITYGROUP GROUP LOGIN&lt;BR /&gt;* UPDATED: Version 9.2 19Jul2006&lt;BR /&gt;*&lt;BR /&gt;****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************&lt;BR /&gt;****************************************************************************&lt;BR /&gt;** **&lt;BR /&gt;** The following SAS Program is divided into 5 discrete sections in **&lt;BR /&gt;** order to help simplify its overall organization. Each SECTION is **&lt;BR /&gt;** marked by a comment box like this one, with "double bound" asterisk. **&lt;BR /&gt;** Here is a summary of the sections: **&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 1: SAS Option, Macro Variable, and filename Definitions **&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 2: %mduimpc defines canonical datasets and variable lists. **&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 3: Extract User Information from a etc/passwd file, normalize **&lt;BR /&gt;** data, and create corresponding canonical datasets. **&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 4: Extract Group Information from a etc/group file, normalize **&lt;BR /&gt;** data, and create corresponding canonical datasets. **&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 5: %mduimpl reads the canonical datasets, generates **&lt;BR /&gt;** XML representing metadata objects, and invokes PROC **&lt;BR /&gt;** METADATA to load the metadata. **&lt;BR /&gt;** **&lt;BR /&gt;** In order to run this program, you will verify and change the filerefs **&lt;BR /&gt;** that specify the location of the passwd and group files where user **&lt;BR /&gt;** information is read from and the SAS Metadata Server that recieves **&lt;BR /&gt;** this information in the form of XML representing metadata objects. **&lt;BR /&gt;** This information is specified in SECTION 1 below. **&lt;BR /&gt;** **&lt;BR /&gt;** CAUTION: before running this program, please read the SAS code below, **&lt;BR /&gt;** SECTION by SECTION, to gain an understanding of its overall flow. It **&lt;BR /&gt;** is especially important to understand which user accounts will be **&lt;BR /&gt;** imported and which will be dropped as the Person information is **&lt;BR /&gt;** extracted and constructed in SECTION 3. The amount of modification **&lt;BR /&gt;** reqired could vary from site to site depending on the form of the **&lt;BR /&gt;** passwd file and it's contents. Also note that the same principles **&lt;BR /&gt;** apply for the code used to retrieve groups in SECTION 4. **&lt;BR /&gt;** **&lt;BR /&gt;** **&lt;BR /&gt;** Format of the etc/passwd file **&lt;BR /&gt;** **&lt;BR /&gt;** This example was developed with an etc\passwd file that followed the **&lt;BR /&gt;** normal conventions, but contained additional user info in the **&lt;BR /&gt;** Gcos field (the 5th ':' delimited field) that is used to build the **&lt;BR /&gt;** user info. The standard form of the file is: **&lt;BR /&gt;** **&lt;BR /&gt;** user name : password : uid (numeric) : primary group id : &amp;lt;continued&amp;gt; **&lt;BR /&gt;** gcos-field : home-directory : login-shell **&lt;BR /&gt;** **&lt;BR /&gt;** Within the gcos-field there are other fields that are comma **&lt;BR /&gt;** delimited. Our gcos-field has the following format: **&lt;BR /&gt;** **&lt;BR /&gt;** Person Name , Office , phone extension , misc , employeeid **&lt;BR /&gt;** **&lt;BR /&gt;** Putting the standard passwd file together with our specific **&lt;BR /&gt;** gcos-field results in passwd entries that look like: **&lt;BR /&gt;** **&lt;BR /&gt;** user name:password:uid (numeric):primary group id:&amp;lt;continued&amp;gt; **&lt;BR /&gt;** Person Name,Office,phone extension,misc,employeeid:&amp;lt;continued&amp;gt; **&lt;BR /&gt;** Home-directory:login-shell **&lt;BR /&gt;** **&lt;BR /&gt;** Colons and Commas delimit the fields in the entries above. If your **&lt;BR /&gt;** etc/passwd file does not match this layout. You will have to modify **&lt;BR /&gt;** the code below by removing the extraction of certain information **&lt;BR /&gt;** (phone numbers, addresses) or extracting it from other fields. **&lt;BR /&gt;** Note, in our example the info in the gcos-field was comma delimited **&lt;BR /&gt;** there is no specification as to what delimiter must be used. The **&lt;BR /&gt;** only specification is that a colon cannot be used because it is used **&lt;BR /&gt;** to delimit the main fields of the passwd file. **&lt;BR /&gt;** **&lt;BR /&gt;** **&lt;BR /&gt;** Format of the etc/group file **&lt;BR /&gt;** **&lt;BR /&gt;** There is nothing special about the format of the group file used to **&lt;BR /&gt;** build this example. There are not special gcos-fields within the **&lt;BR /&gt;** group file so it's not likely that this section of code would need **&lt;BR /&gt;** much modification unless you simply didn't want to extract the groups.**&lt;BR /&gt;** The format of the standard etc/group file is: **&lt;BR /&gt;** **&lt;BR /&gt;** groupname : password : gid (numerid) : comma delimited list of users **&lt;BR /&gt;** **&lt;BR /&gt;** The fields of the group file are colon delimited and the members **&lt;BR /&gt;** of the group are specified as a comma delimited list in the last **&lt;BR /&gt;** colon delimited field. Usernames are used in the list rather than **&lt;BR /&gt;** the numeric uids. Groups are not allowed to be members of other **&lt;BR /&gt;** groups. **&lt;BR /&gt;****************************************************************************&lt;BR /&gt;****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************&lt;BR /&gt;****************************************************************************&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 1: SAS Option, Macro Variable, and filename Definitions **&lt;BR /&gt;** **&lt;BR /&gt;****************************************************************************&lt;BR /&gt;****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* Use the Meta* options to specify the metadata server connection options */&lt;BR /&gt;/* where the user information will be loaded. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;options metaserver=sasmeta.corp.com /* network name/address of the */&lt;BR /&gt;/* metadata server. */&lt;BR /&gt;&lt;BR /&gt;metaport=8562 /* Port Metadata Server is listening on.*/&lt;BR /&gt;&lt;BR /&gt;metauser="sasadm@saspw" /* Domain Qualified Userid for */&lt;BR /&gt;/* connection to metadata server. */&lt;BR /&gt;&lt;BR /&gt;metapass="xxxxxxxxxxxxxxxx" /* Password for userid above. */&lt;BR /&gt;&lt;BR /&gt;metaprotocol=bridge /* Protocol for Metadata Server. */&lt;BR /&gt;&lt;BR /&gt;metarepository=Foundation; /* Default location of user information */&lt;BR /&gt;/* is in the foundation repository. */&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* Define the tag that will be included in the Context attribute of */&lt;BR /&gt;/* ExternalIdentity objects associated with the information loaded by this */&lt;BR /&gt;/* application. This tag will make it easier to determine where information*/&lt;BR /&gt;/* originated from when synchronization tools become available. */&lt;BR /&gt;/* Note, the value of this macro should not be quoted. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;%let PWExtIDTag = Passwd File Import;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* This process will extract UNIX password file information into datasets */&lt;BR /&gt;/* in the libref represented by the "extractlibref" macro variable. The */&lt;BR /&gt;/* extracted information will be cleansed and normalized in this library */&lt;BR /&gt;/* and then transferred into the canonical form datasets defined in the */&lt;BR /&gt;/* %mduimpc macro. */&lt;BR /&gt;/* */&lt;BR /&gt;/* Specify the library to where the passwd and group Files information */&lt;BR /&gt;/* should be extracted. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;%let extractlibref=work;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* Specify the location of the passwd and group files. Typically this will */&lt;BR /&gt;/* be located in the /etc directory. However, if they are located in a */&lt;BR /&gt;/* different location, specify it here. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/*filename grpfile "/etc/group";&lt;BR /&gt;filename pwfile "/etc/passwd";*/&lt;BR /&gt;&lt;BR /&gt;filename grpfile "/home";&lt;BR /&gt;filename pwfile "/home";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* Set the name of the AuthenticationDomain in the metadata to which logins */&lt;BR /&gt;/* created by the process should be associated. Note, there is no */&lt;BR /&gt;/* requirement that the name of the MetadataAuthDomain match an actual */&lt;BR /&gt;/* network domain. The default value is "DefaultAuth". */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;%let MetadataAuthDomain=DefaultAuth;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* EMAIL addresses are in the form: userid@domain. The userid value is */&lt;BR /&gt;/* extracted from the passwd file below. Supply the domain portion of the */&lt;BR /&gt;/* email addresses in the UNIXEMAILDOMAIN macro variable. */&lt;BR /&gt;/* */&lt;BR /&gt;/* NOTE: If your email environment supports a different convention for */&lt;BR /&gt;/* EMAIL addresses then modifications in the code below may be required if */&lt;BR /&gt;/* the EMAIL addresses are needed in the metadata being created. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;%let UNIXEMAILDOMAIN=EMAIL.ACCOUNTS.DOMAIN;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* The importlibref macro variable declares the libref where the normalized */&lt;BR /&gt;/* datasets defined by the macro %mduimpc will be created in the processing */&lt;BR /&gt;/* below. It is VERY important to NOT change any &amp;amp;importlibref reference in */&lt;BR /&gt;/* the code below. If you want to save the normalized datasets in a */&lt;BR /&gt;/* specific library then uncomment libname xxxx 'your_path_name';. */&lt;BR /&gt;/* supply your own path name, and change %let importlibref=work; to */&lt;BR /&gt;/* %let importlibref=xxxx; where xxxx is a libref name of your choosing. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;/* libname xxxx 'your_path_name'; */&lt;BR /&gt;%let importlibref=work;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* filename for location where macro %mduimpl saves its generated XML */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;filename keepxml "request.xml" lrecl=1024;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************&lt;BR /&gt;****************************************************************************&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 2: %mduimpc defines canonical datasets and variable lists. **&lt;BR /&gt;** **&lt;BR /&gt;****************************************************************************&lt;BR /&gt;****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* Invoke the %mduimpc macro to generate the macro variables used to define */&lt;BR /&gt;/* the canonical datasets and columns for input to the %mduimpl macro. The */&lt;BR /&gt;/* %mduimpl (see end of program) macro reads the canonical form datasets, */&lt;BR /&gt;/* builds an XML stream containing user information, and loads this user */&lt;BR /&gt;/* information into the metadata server specified in the meta options above.*/&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;%mduimpc(libref=&amp;amp;importlibref,maketable=0);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************&lt;BR /&gt;****************************************************************************&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 3: Extract User Information from etc/passwd. normalize **&lt;BR /&gt;** data, and create corresponding canonical datasets. **&lt;BR /&gt;** **&lt;BR /&gt;****************************************************************************&lt;BR /&gt;****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* The following datastep reads the UNIX password file and creates the */&lt;BR /&gt;/* unixUsers dataset. Please note that the record format of UNIX PW files */&lt;BR /&gt;/* can vary somewhat. For example, the "custominfo" variable that is */&lt;BR /&gt;/* commented out below actually represents a field in the record that is */&lt;BR /&gt;/* further subdivided into name, office, officeph, unknown, and empid in */&lt;BR /&gt;/* the UNIX PW file that was used for testing this example. */&lt;BR /&gt;/* */&lt;BR /&gt;/* NOTE: These variables may be freely modified to accomodate the UNIX PW */&lt;BR /&gt;/* file found at your site. WARNING: If you change the names of any of */&lt;BR /&gt;/* these variables, be aware that they are also used in the code that */&lt;BR /&gt;/* follows. */&lt;BR /&gt;/* */&lt;BR /&gt;/* NOTE: An assumption is made that the user information will include an */&lt;BR /&gt;/* Employee ID (empid). If empid for a particular passwd entry is empty */&lt;BR /&gt;/* then that entry will be dropped from the import. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;data &amp;amp;extractlibref..unixUsers (keep=keyid userid gid displayname );&lt;BR /&gt;&lt;BR /&gt;attrib keyid informat=$30. format=$30.;&lt;BR /&gt;attrib userid informat=$10. format=$10.;&lt;BR /&gt;attrib password informat=$13. format=$13.;&lt;BR /&gt;attrib uid informat=$32. format=$12.;&lt;BR /&gt;attrib gid informat=$32. format=$12.;&lt;BR /&gt;/*attrib custominfo informat=$64. format=$64.;*/&lt;BR /&gt;attrib displayname informat=$128. format=$128.;&lt;BR /&gt;attrib empid informat=$30. format=$30.;&lt;BR /&gt;attrib userhome informat=$50. format=$50.;&lt;BR /&gt;attrib usershell informat=$24. format=$24.;&lt;BR /&gt;&lt;BR /&gt;infile pwfile delimiter = ':,' MISSOVER DSD;&lt;BR /&gt;input userid $&lt;BR /&gt;password $&lt;BR /&gt;uid $&lt;BR /&gt;gid $&lt;BR /&gt;/* custominfo $ is a summary of the following 5 fields */&lt;BR /&gt;displayname $&lt;BR /&gt;empid $&lt;BR /&gt;userhome $&lt;BR /&gt;usershell $ ;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* If an account does not contain and Employee ID, then drop that */&lt;BR /&gt;/* account from the import. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;if empid = "" then do;&lt;BR /&gt;delete;&lt;BR /&gt;return;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;/***************************************************************************/&lt;BR /&gt;/* In our example data, accounts were disabled by entering a *DELETED* */&lt;BR /&gt;/* or *NOLOGIN* in the password field. If any password field begins with */&lt;BR /&gt;/* an asterisk, then consider that account invalid and drop it from the */&lt;BR /&gt;/* import. */&lt;BR /&gt;/***************************************************************************/&lt;BR /&gt;if substrn(password,1,1) = "*" then do;&lt;BR /&gt;delete;&lt;BR /&gt;return;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;uid = compress("U_" || uid);&lt;BR /&gt;gid = compress("G_" || gid);&lt;BR /&gt;&lt;BR /&gt;/***************************************************************************/&lt;BR /&gt;/* The keyid must uniquely identify a single person in the person dataset. */&lt;BR /&gt;/* If the keyid is not unique, the mduimpl macro will purge duplicates, */&lt;BR /&gt;/* leaving only 1 person object with a particular keyid to be loaded into */&lt;BR /&gt;/* the metadata. */&lt;BR /&gt;/* */&lt;BR /&gt;/* In this example, we have selected to use the uid of the account */&lt;BR /&gt;/* as the keyid. */&lt;BR /&gt;/* */&lt;BR /&gt;/* NOTES: */&lt;BR /&gt;/* 1- the keyid is also used to relate login, email, phone, address and */&lt;BR /&gt;/* group information to a particular user. So, if two users share the */&lt;BR /&gt;/* same keyid, one of them will get all the info for both users while */&lt;BR /&gt;/* the other is purged. */&lt;BR /&gt;/* */&lt;BR /&gt;/* 2- The keyid is written to an ExternalIdentity object that is */&lt;BR /&gt;/* associated to the person. The external identity can be used to */&lt;BR /&gt;/* determine where a user's information came from and how to */&lt;BR /&gt;/* synchronize it. Care must be taken when determining what */&lt;BR /&gt;/* value to use for the keyid and the implications that decision may */&lt;BR /&gt;/* have. */&lt;BR /&gt;/* */&lt;BR /&gt;/* 3- If the keyid is some sort of global user identifier (like an */&lt;BR /&gt;/* employeeid) it may be possible to merge login information extracted */&lt;BR /&gt;/* from another authentication system with the user information */&lt;BR /&gt;/* extracted here. The addition/merging of additional information */&lt;BR /&gt;/* can take place from the extraction and loading of this information. */&lt;BR /&gt;/* However, the ability to perform the merge would depend on both */&lt;BR /&gt;/* authentication systems using the same global identifier to relate */&lt;BR /&gt;/* ownership of the account to a person. In this case, the */&lt;BR /&gt;/* global identifier should be used as the keyid. */&lt;BR /&gt;/***************************************************************************/&lt;BR /&gt;&lt;BR /&gt;keyid = uid;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************************/&lt;BR /&gt;/* Non-printable characters (e.g. BACKSPACE 0x080) have been observed in displayname*/&lt;BR /&gt;/* coming from the "custominfo". These characters trouble the XML parser in the */&lt;BR /&gt;/* SAS Metadata Server during the load process. The following loop recodes any */&lt;BR /&gt;/* embedded non-printable ASCII characters found in the name string to blanks */&lt;BR /&gt;/* (which are digestible by the XML parser). If a non-pritable character is */&lt;BR /&gt;/* found at the of the string, the string is simply truncated by one character. */&lt;BR /&gt;/************************************************************************************/&lt;BR /&gt;_NOTPRINT = notprint( displayname, 1);&lt;BR /&gt;do while ( _NOTPRINT );&lt;BR /&gt;put "non-printable character(s): " displayname=;&lt;BR /&gt;displaynameL = length(displayname);&lt;BR /&gt;if ( _NOTPRINT EQ displaynameL ) then do; /* found at end of the string */&lt;BR /&gt;displayname = substr(displayname,1,displaynameL-1);&lt;BR /&gt;_NOTPRINT = 0; /* set up to exit */&lt;BR /&gt;end;&lt;BR /&gt;else do; /* found within the string */&lt;BR /&gt;substr(displayname,_NOTPRINT,1) = " ";&lt;BR /&gt;_NOTPRINT = notprint( displayname, _NOTPRINT+1 ); /* any more bad? */&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/******************************************************************************************/&lt;BR /&gt;/* The following datastep creates the normalized tables for person, location, */&lt;BR /&gt;/* phone, email, and login from the &amp;amp;extractlibref..unixextrpersons extracted above. */&lt;BR /&gt;/******************************************************************************************/&lt;BR /&gt;&lt;BR /&gt;data &amp;amp;persontbla /* Macros to define Normalized Tables from %mduimpc */&lt;BR /&gt;&amp;amp;locationtbla&lt;BR /&gt;&amp;amp;phonetbla&lt;BR /&gt;&amp;amp;emailtbla&lt;BR /&gt;&amp;amp;logintbla&lt;BR /&gt;;&lt;BR /&gt;%definepersoncols; /* Macros to define Normalized Table Columns from %mduimpc */&lt;BR /&gt;%definelocationcols;&lt;BR /&gt;%definephonecols;&lt;BR /&gt;%defineemailcols;&lt;BR /&gt;%definelogincols;&lt;BR /&gt;&lt;BR /&gt;retain city postalcode area country "";&lt;BR /&gt;&lt;BR /&gt;set &amp;amp;extractlibref..unixUsers; /* (obs=x for testing) */&lt;BR /&gt;&lt;BR /&gt;/* name is already in the input dataset */&lt;BR /&gt;/* title cannot be derived from the UNIX PW file */&lt;BR /&gt;name=userid;&lt;BR /&gt;title="";&lt;BR /&gt;description="";&lt;BR /&gt;output &amp;amp;persontbl;&lt;BR /&gt;&lt;BR /&gt;/* setup location values */&lt;BR /&gt;if office NE "" then do;&lt;BR /&gt;locationName = strip(name) || " Office";&lt;BR /&gt;locationtype = "Office";&lt;BR /&gt;address = office;&lt;BR /&gt;&lt;BR /&gt;output &amp;amp;locationtbl;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;if officeph NE "" then do;&lt;BR /&gt;phonenumber = officeph;&lt;BR /&gt;phonetype = "Office";&lt;BR /&gt;output &amp;amp;phonetbl;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;/* create email address based on useid and the UNIXEMAILDOMAIN */&lt;BR /&gt;/* macro variable. */&lt;BR /&gt;emailAddr = compress(userid) || "@" || "&amp;amp;UNIXEMAILDOMAIN";&lt;BR /&gt;emailType = "Office";&lt;BR /&gt;output &amp;amp;emailtbl;&lt;BR /&gt;&lt;BR /&gt;if userid NE "" then do;&lt;BR /&gt;password ="";&lt;BR /&gt;authdomkeyid = 'domkey' || compress(upcase("&amp;amp;MetadataAuthDomain"));&lt;BR /&gt;&lt;BR /&gt;output &amp;amp;logintbl;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* Each person entry in &amp;amp;persontbl must be unique according to the */&lt;BR /&gt;/* rules for Metadata Authorization Identities. By enforcing this */&lt;BR /&gt;/* uniqueness here, we help ensure that the Metadata XML will load */&lt;BR /&gt;/* correctly when the %mduimpl macro is invoked with submit=1 below. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;&lt;BR /&gt;proc sort data=&amp;amp;persontbl nodupkey;&lt;BR /&gt;by keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc datasets library=&amp;amp;importlibref memtype=data; /* Create Index for */&lt;BR /&gt;modify person; /* speedy retrieval */&lt;BR /&gt;index create keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* Because standard UNIX PW files (i.e. PW files that don't link to */&lt;BR /&gt;/* dirctory systems, etc.) only provide simple location info (e.g. */&lt;BR /&gt;/* office number), the possibilty of multiple locations per person does */&lt;BR /&gt;/* not really exist. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;&lt;BR /&gt;proc sort data=&amp;amp;locationtbl nodupkey;&lt;BR /&gt;by keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc datasets library=&amp;amp;importlibref memtype=data; /* Create Index for */&lt;BR /&gt;modify location; /* speedy retrieval */&lt;BR /&gt;index create keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* Each person can have zero or more entries in &amp;amp;phonetbl. Each */&lt;BR /&gt;/* entry will be a unique combination of keyid and phone number. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;&lt;BR /&gt;proc sort data=&amp;amp;phonetbl nodupkey;&lt;BR /&gt;by keyid phonenumber;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc datasets library=&amp;amp;importlibref memtype=data; /* Create Index for */&lt;BR /&gt;modify phone; /* speedy retrieval */&lt;BR /&gt;index create keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* Each person can have zero or more entries in &amp;amp;emailtbl. Purge any */&lt;BR /&gt;/* duplicate entries. Note, Dups should not occur so long as the */&lt;BR /&gt;/* there are no duplicate entries in the passwd file. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;&lt;BR /&gt;proc sort data=&amp;amp;emailtbl nodupkey;&lt;BR /&gt;by keyid emailAddr;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc datasets library=&amp;amp;importlibref memtype=data; /* Create Index for */&lt;BR /&gt;modify email; /* speedy retrieval */&lt;BR /&gt;index create keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* Because each person can have multiple logins, the entries by */&lt;BR /&gt;/* keyid are not required to be unique. However, the UserID */&lt;BR /&gt;/* attribute by relation to AuthenticationDomain must be unique for */&lt;BR /&gt;/* each login owned by a person, *and* a login can only be related */&lt;BR /&gt;/* to one person. These constraints are enforced during processing */&lt;BR /&gt;/* in the %mduimpl macro, which is invoked below. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;proc sort data=&amp;amp;logintbl;&lt;BR /&gt;by keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc datasets library=&amp;amp;importlibref memtype=data; /* Create Index for */&lt;BR /&gt;modify logins; /* speedy retrieval */&lt;BR /&gt;index create keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************&lt;BR /&gt;****************************************************************************&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 4: Extract Group Information from /etc/group, normalize **&lt;BR /&gt;** data, and create corresponding canonical datasets. **&lt;BR /&gt;** **&lt;BR /&gt;****************************************************************************&lt;BR /&gt;****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* The following datastep reads the UNIX group file and creates the */&lt;BR /&gt;/* unixgroups and unixGroupMembers datasets. */&lt;BR /&gt;/* */&lt;BR /&gt;/* **The Group file contains only secondary group membership information. */&lt;BR /&gt;/* In other words, the passwd file contained user account information and */&lt;BR /&gt;/* the primary group membership for the account. This primary group */&lt;BR /&gt;/* membership is only reflected in the passwd file, not the group file. */&lt;BR /&gt;/* To build the complete group membership, we'll have to combine the group */&lt;BR /&gt;/* membership information from both the passwd and group files. */&lt;BR /&gt;/* */&lt;BR /&gt;/* See comments at the beginning of this example file for information */&lt;BR /&gt;/* regarding the format of the group file. Note though that the members */&lt;BR /&gt;/* are specified using the account user name (userid) that can be found */&lt;BR /&gt;/* in the 1st field of a passwd file entry. */&lt;BR /&gt;/* */&lt;BR /&gt;/* NOTE: These variables may be freely modified to accomodate the UNIX PW */&lt;BR /&gt;/* file found at your site. WARNING: If you change the names of any of */&lt;BR /&gt;/* these variables, be aware that they are also used in the code that */&lt;BR /&gt;/* follows. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;data &amp;amp;extractlibref..unixGroups (keep=gid name)&lt;BR /&gt;&amp;amp;extractlibref..unixGroupMembers (keep=gid name member);&lt;BR /&gt;&lt;BR /&gt;attrib name informat=$50. format=$50.;&lt;BR /&gt;attrib gid informat=$32. format=$12.;&lt;BR /&gt;attrib member informat=$50. format=$50.;&lt;BR /&gt;&lt;BR /&gt;length membersOff 8 membersLen 8 memWord 8 memCnt 8;&lt;BR /&gt;&lt;BR /&gt;infile grpfile LRECL=32756 length=Len;&lt;BR /&gt;input;&lt;BR /&gt;&lt;BR /&gt;name = scan(_infile_,1,':'); /* first word is group Name */&lt;BR /&gt;nameL = length(name);&lt;BR /&gt;&lt;BR /&gt;/* Check to see if a group PW is present */&lt;BR /&gt;if ( substr(_infile_,nameL+1,2) EQ "::" ) then do;&lt;BR /&gt;gid = scan(_infile_,2,':'); /* second real word is usually the group ID */&lt;BR /&gt;membersOff = nameL + 2 + length(gid) + 1;&lt;BR /&gt;end;&lt;BR /&gt;else do; /* unless a group PW is present then */&lt;BR /&gt;pw = scan(_infile_,2,':'); /* second real word is the group PW */&lt;BR /&gt;gid = scan(_infile_,3,':'); /* the third word is group ID */&lt;BR /&gt;membersOff = nameL + 1 + length(pw) + 1 + length(gid) + 1;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;if input(gid, best16.0) &amp;gt; 0; /* Don't add nogroup or root to datasets */&lt;BR /&gt;&lt;BR /&gt;gid = compress("G_" || gid);&lt;BR /&gt;output &amp;amp;extractlibref..unixGroups; /* Add to groups dataset */&lt;BR /&gt;&lt;BR /&gt;membersLen = Len - membersOff;&lt;BR /&gt;/* groups can be defined without members. If members are */&lt;BR /&gt;/* present then add an entry for each to the members dataset */&lt;BR /&gt;if ( membersLen &amp;gt; 0 ) then do;&lt;BR /&gt;members = substr(_infile_,membersOff+1,membersLen);&lt;BR /&gt;memWord=1;&lt;BR /&gt;memCnt = countc(members,",") + 1;&lt;BR /&gt;do while ( memWord LE memCnt );&lt;BR /&gt;member = scan(members,memWord,",");&lt;BR /&gt;output &amp;amp;extractlibref..unixGroupMembers;&lt;BR /&gt;memWord + 1;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/***************************************************************************************/&lt;BR /&gt;/* Each row in the unixGroupMembers Table represts a user's membership in a group. A */&lt;BR /&gt;/* user may be a member of multiple groups and in this case a row will exist for each */&lt;BR /&gt;/* group. Nested groups are not supported in UNIX so the member column will *never* */&lt;BR /&gt;/* contain a group name (... although it may appear that way because UNIX does allow */&lt;BR /&gt;/* a user and a group to have the same name value.) Sort the unixGroupMembers Table */&lt;BR /&gt;/* by member for the processing that follows. */&lt;BR /&gt;/***************************************************************************************/&lt;BR /&gt;&lt;BR /&gt;proc sort data=&amp;amp;extractlibref..unixGroupMembers;&lt;BR /&gt;by member;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc datasets library=&amp;amp;extractlibref memtype=data;&lt;BR /&gt;modify unixGroupMembers;&lt;BR /&gt;index create member;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/***************************************************************************************/&lt;BR /&gt;/* Use the information in the unixUsers dataset that was extracted from the passwd */&lt;BR /&gt;/* file to create a dataset that contains the primary group memberships for accounts */&lt;BR /&gt;/* in the passwd file. */&lt;BR /&gt;/* */&lt;BR /&gt;/* Note the "userid" column will be renamed "member" in the output dataset */&lt;BR /&gt;/* unixUsersAsPrimaryGroupMembers. */&lt;BR /&gt;/***************************************************************************************/&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table &amp;amp;extractlibref..unixUsersInPrimaryGroups&lt;BR /&gt;as select g.gid, u.keyid, g.name, u.userid as member&lt;BR /&gt;from &amp;amp;extractlibref..unixUsers u,&lt;BR /&gt;&amp;amp;extractlibref..unixGroups g&lt;BR /&gt;where u.gid EQ g.gid;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* Build a dataset with the memberships and member keyids for the */&lt;BR /&gt;/* secondary group memberships that are contained in the group file. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table &amp;amp;extractlibref..unixUsersInNonPrimaryGroups&lt;BR /&gt;as select m.gid, u.keyid, m.name, m.member&lt;BR /&gt;from &amp;amp;extractlibref..unixUsers u,&lt;BR /&gt;&amp;amp;extractlibref..unixGroupMembers m&lt;BR /&gt;where m.member EQ u.userid;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;/* Build the canonical groupmems dataset by selecting the appropriate */&lt;BR /&gt;/* columns and concatenating the unixUsersInPrimaryGroups and */&lt;BR /&gt;/* unixUsersInNonPrimaryGroups datasets built above. */&lt;BR /&gt;/****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;data &amp;amp;idgrpmemstbla /* Macros to define canonical Tables from %mduimpc */&lt;BR /&gt;;&lt;BR /&gt;%defineidgrpmemscols; /* Macros to define Table Columns from %mduimpc */&lt;BR /&gt;&lt;BR /&gt;set &amp;amp;extractlibref..unixUsersInPrimaryGroups&lt;BR /&gt;&amp;amp;extractlibref..unixUsersInNonPrimaryGroups;&lt;BR /&gt;&lt;BR /&gt;grpkeyid = gid;&lt;BR /&gt;memkeyid = keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=&amp;amp;idgrpmemstbla;&lt;BR /&gt;by grpkeyid memkeyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc datasets library=&amp;amp;importlibref memtype=data; /* Create Index for */&lt;BR /&gt;modify grpmems; /* speedy retrieval */&lt;BR /&gt;index create grpkeyid;&lt;BR /&gt;quit;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* Build the canonical groups dataset containing the group names and */&lt;BR /&gt;/* keyids. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;&lt;BR /&gt;data &amp;amp;idgrptbla /* Macros to define canonical Tables from %mduimpc */&lt;BR /&gt;;&lt;BR /&gt;%defineidgrpcols; /* Macros to define Table Columns from %mduimpc */&lt;BR /&gt;&lt;BR /&gt;set &amp;amp;extractlibref..unixgroups;&lt;BR /&gt;&lt;BR /&gt;keyid = gid;&lt;BR /&gt;/* Name column moves straight from unixgroups dataset */&lt;BR /&gt;description="";&lt;BR /&gt;grpType="";&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/***************************************************************************************/&lt;BR /&gt;/* Sort and index the idgrps table */&lt;BR /&gt;/***************************************************************************************/&lt;BR /&gt;&lt;BR /&gt;proc sort data=&amp;amp;idgrptbla nodupkey;&lt;BR /&gt;by keyid;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc datasets library=&amp;amp;importlibref memtype=data;&lt;BR /&gt;modify idgrps;&lt;BR /&gt;index create keyid;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* Add the UNIX AuthDom to the AuthenticationDomain dataset */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;&lt;BR /&gt;data &amp;amp;authdomtbl;&lt;BR /&gt;%defineauthdomcols; /* Macros to define Table authdomain from %mduimpc */&lt;BR /&gt;authDomName="&amp;amp;MetadataAuthDomain";&lt;BR /&gt;keyid='domkey' || compress(upcase("&amp;amp;MetadataAuthDomain"));&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/****************************************************************************&lt;BR /&gt;****************************************************************************&lt;BR /&gt;** **&lt;BR /&gt;** SECTION 5: %mduimpl reads the canonical datasets, generates **&lt;BR /&gt;** XML representing metadata objects, and invokes PROC **&lt;BR /&gt;** METADATA to load the metadata. **&lt;BR /&gt;** **&lt;BR /&gt;****************************************************************************&lt;BR /&gt;****************************************************************************/&lt;BR /&gt;&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;/* note, the mduimpl macro will lookup all the person objects by */&lt;BR /&gt;/* external identity and then subsitute the keyid for the login object */&lt;BR /&gt;/* with the objectid of the person any logins that have a keyid that */&lt;BR /&gt;/* isn't found will be dropped from the load. */&lt;BR /&gt;/************************************************************************/&lt;BR /&gt;&lt;BR /&gt;%macro Execute_Load;&lt;BR /&gt;&lt;BR /&gt;/* if the _EXTRACTONLY macro is set, then return and don't do any load processing. */&lt;BR /&gt;%if %symexist(_EXTRACTONLY) %then %return;&lt;BR /&gt;&lt;BR /&gt;%mduimplb(libref=&amp;amp;importlibref,&lt;BR /&gt;extidtag=&amp;amp;PWExtIDTag);&lt;BR /&gt;%mend Execute_Load;&lt;BR /&gt;&lt;BR /&gt;%Execute_Load;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 23:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631740#M18456</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-12T23:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631746#M18457</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/157476"&gt;@a_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To support you here in this forum to get from the SAS provided template code to your site and case specific code is too big of a task - at least for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To understand the template code and amend it to what you need, requires solid SAS developer skills. Based on your questions so far I assume you're a SAS Admin but were never a SAS developer. If so then I'd strongly recommend that you get onsite help for customizing the template code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 00:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631746#M18457</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-13T00:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631788#M18458</link>
      <description>&lt;P&gt;This seems to be way over your head, get help from a consultant.&lt;/P&gt;
&lt;P&gt;We can't provide help for this without sitting in front of your terminal/desktop, and that would mean a consultancy.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 06:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/631788#M18458</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-13T06:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/632504#M18474</link>
      <description>Thank you for your support ..Kurt Bremser.&lt;BR /&gt;&lt;BR /&gt;resolved my issue&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Mar 2020 17:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/632504#M18474</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-16T17:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/632505#M18475</link>
      <description>Thank you ..Patrick&lt;BR /&gt;i resolved the issue ..</description>
      <pubDate>Mon, 16 Mar 2020 17:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/632505#M18475</guid>
      <dc:creator>a_SAS</dc:creator>
      <dc:date>2020-03-16T17:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to add (500) multiple user-id's to SAS Metadata server .</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/925231#M28408</link>
      <description>&lt;P&gt;I recently had a case for a customer who had exactly this situation.&amp;nbsp; I'm a bit surprised that someone hasn't surfaced code for this sooner.&amp;nbsp; &amp;nbsp;Better late than never, a macro for this has been added at&amp;nbsp;&lt;A href="https://github.com/sascommunities/technical-support-code/blob/main/usage/administration/sas-metadata-server/create_metadata_login_s9.sas" target="_blank"&gt;technical-support-code/usage/administration/sas-metadata-server/create_metadata_login_s9.sas at main · sascommunities/technical-support-code · GitHub&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%createLoginObject(
   Person_Name=sasdemo              /* REQUIRED: metadata name for Person object                       */
  ,Authdomain=OracleAuth            /* REQUIRED: metadata name for the Authdomain for the Login object */
  ,Login_userid=scott               /* OPTIONAL: userid attribute for the Login object                 */
  ,Login_password=tiger             /* OPTIONAL: password attribute for the Login object               */
  ,Login_Name=sasdemo Oracle login  /* OPTIONAL: metadata name for the Login object                    */
 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Carl Sommer - SAS Technical Support&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 13:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-add-500-multiple-user-id-s-to-SAS-Metadata-server/m-p/925231#M28408</guid>
      <dc:creator>carl_sommer</dc:creator>
      <dc:date>2024-04-22T13:45:17Z</dc:date>
    </item>
  </channel>
</rss>

