<?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 set a user-generated ID's to a set of values in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4656#M1890</link>
    <description>That worked, but giving random numbers.&lt;BR /&gt;
&lt;BR /&gt;
I used id=_N_, which gave observation number as id.&lt;BR /&gt;
&lt;BR /&gt;
thanks,</description>
    <pubDate>Thu, 13 Sep 2007 14:52:08 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-09-13T14:52:08Z</dc:date>
    <item>
      <title>How to set a user-generated ID's to a set of values</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4654#M1888</link>
      <description>Hi,&lt;BR /&gt;
   By making connection to a database in SAS, I can select particular columns  from a table and this process continues for a set of time periods and all data is meged. Now I want to select a random generated ID's for each and every row that was selected, when I query the final data set.&lt;BR /&gt;
&lt;BR /&gt;
How to get this?&lt;BR /&gt;
&lt;BR /&gt;
thanks,</description>
      <pubDate>Tue, 11 Sep 2007 19:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4654#M1888</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-09-11T19:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to set a user-generated ID's to a set of values</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4655#M1889</link>
      <description>Hope I understand what your after.&lt;BR /&gt;
&lt;BR /&gt;
One way:&lt;BR /&gt;
&lt;BR /&gt;
DATA two;&lt;BR /&gt;
  SET one;&lt;BR /&gt;
  id = Uniform(0); * this will generate pseudo random numbers;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
* sort on the random numbers;&lt;BR /&gt;
PROC SORT DATA=two;&lt;BR /&gt;
BY id;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
DATA three;&lt;BR /&gt;
  SET two(OBS=100); *** pick 100 "random" observations ;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
If you have the STAT package, PROC SURVEYSELECT is excellent and very versatile.&lt;BR /&gt;
.&lt;BR /&gt;
The above could be replaced by the following:&lt;BR /&gt;
&lt;BR /&gt;
PROC SURVEYSELECT DATA=one METHOD=srs N=100 OUT=three;&lt;BR /&gt;
RUN;</description>
      <pubDate>Tue, 11 Sep 2007 22:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4655#M1889</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-09-11T22:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to set a user-generated ID's to a set of values</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4656#M1890</link>
      <description>That worked, but giving random numbers.&lt;BR /&gt;
&lt;BR /&gt;
I used id=_N_, which gave observation number as id.&lt;BR /&gt;
&lt;BR /&gt;
thanks,</description>
      <pubDate>Thu, 13 Sep 2007 14:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4656#M1890</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-09-13T14:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to set a user-generated ID's to a set of values</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4657#M1891</link>
      <description>Also, below one worked:&lt;BR /&gt;
&lt;BR /&gt;
        id1='000'||left(put(_N_,best10.))&lt;BR /&gt;
&lt;BR /&gt;
thanks</description>
      <pubDate>Thu, 13 Sep 2007 14:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-set-a-user-generated-ID-s-to-a-set-of-values/m-p/4657#M1891</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-09-13T14:58:03Z</dc:date>
    </item>
  </channel>
</rss>

