<?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 assign a UUID  to a data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-a-UUID-to-a-data-set/m-p/675155#M203379</link>
    <description>&lt;P&gt;What you describe sounds like you want UUID per observation.&lt;/P&gt;
&lt;P&gt;If you mean to add an identifier then you may be looking for the UUIDGEN function. The example data set creates a 32 character id using the function. If you don't assign a length for the variable it will default to 200 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   length id $ 32;
   do i=1 to 10;
      id = uuidgen();
     output;
   end;
run;
   
&lt;/PRE&gt;
&lt;P&gt;If you want the same value for all records in a data set you would use something like&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   length id $ 32;
   retain id;
   if _n_=1 then id = uuidgen();
run;&lt;/PRE&gt;
&lt;P&gt;Or generate a single value one record data set and use a join in Proc SQL to add the value to all the records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Aug 2020 22:14:43 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-08-06T22:14:43Z</dc:date>
    <item>
      <title>How to assign a UUID  to a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-a-UUID-to-a-data-set/m-p/675099#M203351</link>
      <description>&lt;P&gt;Have you ever assigned a universal unique identification (UUID) to a data set in SAS 9.4 or SAS EG? We need to prep our datasets for SQL database and we need to make sure each observation from one data set share the same UUID that is different from all other datasets.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 18:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-a-UUID-to-a-data-set/m-p/675099#M203351</guid>
      <dc:creator>sunshineca55</dc:creator>
      <dc:date>2020-08-06T18:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign a UUID  to a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-a-UUID-to-a-data-set/m-p/675155#M203379</link>
      <description>&lt;P&gt;What you describe sounds like you want UUID per observation.&lt;/P&gt;
&lt;P&gt;If you mean to add an identifier then you may be looking for the UUIDGEN function. The example data set creates a 32 character id using the function. If you don't assign a length for the variable it will default to 200 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   length id $ 32;
   do i=1 to 10;
      id = uuidgen();
     output;
   end;
run;
   
&lt;/PRE&gt;
&lt;P&gt;If you want the same value for all records in a data set you would use something like&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   length id $ 32;
   retain id;
   if _n_=1 then id = uuidgen();
run;&lt;/PRE&gt;
&lt;P&gt;Or generate a single value one record data set and use a join in Proc SQL to add the value to all the records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 22:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-a-UUID-to-a-data-set/m-p/675155#M203379</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-08-06T22:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign a UUID  to a data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-a-UUID-to-a-data-set/m-p/675164#M203387</link>
      <description>&lt;P&gt;Thank you so much, this worked really well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 23:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-a-UUID-to-a-data-set/m-p/675164#M203387</guid>
      <dc:creator>sunshineca55</dc:creator>
      <dc:date>2020-08-06T23:18:23Z</dc:date>
    </item>
  </channel>
</rss>

