<?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 SEQUENTIAL NUMBER CREATION in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327909#M73192</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below dataset A, I have 4 names with ID numbers, may I know how to create new ID for the new names in dataset, from 1008 to 1011? Below is sample only, i could have thousands of new names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA A;&lt;BR /&gt;INFILE CARDS;&lt;BR /&gt;INPUT ID NAME $;&lt;BR /&gt;CARDS;&lt;BR /&gt;1004 JESSICA&lt;BR /&gt;1005 UTAKA&lt;BR /&gt;1006 MORRISSON&lt;BR /&gt;1007 NELSON&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA B;&lt;BR /&gt;INFILE CARDS;&lt;BR /&gt;INPUT NAME $;&lt;BR /&gt;CARDS;&lt;BR /&gt;RYAN&lt;BR /&gt;HOLLY&lt;BR /&gt;MASON&lt;BR /&gt;DORREN&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2017 01:51:07 GMT</pubDate>
    <dc:creator>scb</dc:creator>
    <dc:date>2017-01-27T01:51:07Z</dc:date>
    <item>
      <title>SEQUENTIAL NUMBER CREATION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327909#M73192</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below dataset A, I have 4 names with ID numbers, may I know how to create new ID for the new names in dataset, from 1008 to 1011? Below is sample only, i could have thousands of new names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA A;&lt;BR /&gt;INFILE CARDS;&lt;BR /&gt;INPUT ID NAME $;&lt;BR /&gt;CARDS;&lt;BR /&gt;1004 JESSICA&lt;BR /&gt;1005 UTAKA&lt;BR /&gt;1006 MORRISSON&lt;BR /&gt;1007 NELSON&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA B;&lt;BR /&gt;INFILE CARDS;&lt;BR /&gt;INPUT NAME $;&lt;BR /&gt;CARDS;&lt;BR /&gt;RYAN&lt;BR /&gt;HOLLY&lt;BR /&gt;MASON&lt;BR /&gt;DORREN&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 01:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327909#M73192</guid>
      <dc:creator>scb</dc:creator>
      <dc:date>2017-01-27T01:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: SEQUENTIAL NUMBER CREATION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327912#M73193</link>
      <description>&lt;P&gt;Are you using solely SAS? Many DBs have auto-incrementing&amp;nbsp;IDs which is why I ask.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 02:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327912#M73193</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-27T02:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: SEQUENTIAL NUMBER CREATION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327913#M73194</link>
      <description>&lt;P&gt;Yes, SAS only.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 02:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327913#M73194</guid>
      <dc:creator>scb</dc:creator>
      <dc:date>2017-01-27T02:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: SEQUENTIAL NUMBER CREATION</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327914#M73195</link>
      <description>&lt;P&gt;Data want;&lt;/P&gt;
&lt;P&gt;set a(in=AI)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; B(in=BI);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;retain maxid count 0;&lt;/P&gt;
&lt;P&gt;if AI and id&amp;gt;MaxID then maxID=ID;&lt;/P&gt;
&lt;P&gt;if BI then Do;&lt;/P&gt;
&lt;P&gt;count+1;&lt;/P&gt;
&lt;P&gt;ID=maxID + count;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can possibly be simplified massively but it's easy to understand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: fixed typo. Also, this is untested.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 02:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SEQUENTIAL-NUMBER-CREATION/m-p/327914#M73195</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-27T02:30:04Z</dc:date>
    </item>
  </channel>
</rss>

