<?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 generate IDs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323212#M71600</link>
    <description>&lt;P&gt;Here is the solution but in R programming. So can you please change it to SAS programming.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Block &amp;lt;- c("Badlapur","Barsathi","Bhitargaon","Bilhaur","Chaubepur","Dharampur",&lt;BR /&gt;"Dobhi","Ghatampur","Kakwan","Kalyanpur","Karanjakala","KHUTHAN",&lt;BR /&gt;"Mahrajganj","Mariahu","Rampur","Shahganj","Shivrajpur","Sikrara",&lt;BR /&gt;"Sirkoni","SUITHAKALA")&lt;/P&gt;&lt;P&gt;NoA &amp;lt;- c(6,7,15,26,20,27,10,15,17,20,80,8,34,18,7,66,20,19,30,12)&lt;/P&gt;&lt;P&gt;NoV &amp;lt;- c(3,6,30,63,45,66,15,30,36,45,225,9,87,39,6,183,45,42,75,21)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for(m in 1:20){&lt;BR /&gt;a &amp;lt;- NoA[m]&lt;BR /&gt;b &amp;lt;- NoV[m]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for(j in 1:a){&lt;BR /&gt;for(i in 1:b){&lt;BR /&gt;&lt;BR /&gt;print(paste0(Block[m],j,"_",i))&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;/P&gt;</description>
    <pubDate>Sun, 08 Jan 2017 11:39:06 GMT</pubDate>
    <dc:creator>pankajdev0027</dc:creator>
    <dc:date>2017-01-08T11:39:06Z</dc:date>
    <item>
      <title>How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323155#M71583</link>
      <description>&lt;DIV&gt;Can you please help me in this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Question:- An Excel file,(Attached with the question) which has a list of villages and the number of auditors required for each block, then you have to create unique IDs for each block. If, for example, there are three villages in a block and six auditors are required, then you need to create 18 unique IDs for the block.&lt;/DIV&gt;&lt;DIV&gt;Can you generate unique IDs for each block in a similar fashion? Using SAS or any other tools.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;please reply asap or before Sunday.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks in advance.&lt;/DIV&gt;</description>
      <pubDate>Sat, 07 Jan 2017 15:30:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323155#M71583</guid>
      <dc:creator>pankajdev0027</dc:creator>
      <dc:date>2017-01-07T15:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323160#M71586</link>
      <description>Your explanation does not match with the villages like for example barsathi , dharampur where the villages are less and auditors are more as per the data provided</description>
      <pubDate>Sat, 07 Jan 2017 16:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323160#M71586</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-01-07T16:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323162#M71588</link>
      <description>For Example&lt;BR /&gt;Block Name= Barsathi&lt;BR /&gt;No. of auditors Required = 7&lt;BR /&gt;No. of Villages = 6&lt;BR /&gt;No. of IDs required = 42.&lt;BR /&gt;&lt;BR /&gt;So the IDs will be Generate like&lt;BR /&gt;&lt;BR /&gt;Barasathi1_1&lt;BR /&gt;Barasathi1_2&lt;BR /&gt;Barasathi1_3&lt;BR /&gt;Barasathi1_4&lt;BR /&gt;Barasathi1_5&lt;BR /&gt;Barasathi1_6&lt;BR /&gt;Barasathi2_1&lt;BR /&gt;Barasathi2_2&lt;BR /&gt;Barasathi2_3&lt;BR /&gt;Barasathi2_4&lt;BR /&gt;Barasathi2_5&lt;BR /&gt;Barasathi2_6&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;.&lt;BR /&gt;Barasathi7_1&lt;BR /&gt;Barasathi7_2&lt;BR /&gt;Barasathi7_3&lt;BR /&gt;Barasathi7_4&lt;BR /&gt;Barasathi7_5&lt;BR /&gt;Barasathi7_6&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So total IDs genertaed 42&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Where is the problem Sir.&lt;BR /&gt;</description>
      <pubDate>Sat, 07 Jan 2017 16:47:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323162#M71588</guid>
      <dc:creator>pankajdev0027</dc:creator>
      <dc:date>2017-01-07T16:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323165#M71589</link>
      <description>&lt;P&gt;Sounds like the following would do what you want/need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want (drop=_:);&lt;BR /&gt; informat Block_Name $15.;&lt;BR /&gt; infile cards dlm='09'x;&lt;BR /&gt; input Block_Name No_of_auditors_required No_of_Villages No_of_IDs_required;&lt;BR /&gt; do _i=1 to No_of_auditors_required;&lt;BR /&gt; do _j=1 to No_of_Villages;&lt;BR /&gt; id=catt(Block_Name,_i,'_',_j);&lt;BR /&gt; output;&lt;BR /&gt; end;&lt;BR /&gt; end;&lt;BR /&gt; cards;&lt;BR /&gt;Badlapur 6 3 18&lt;BR /&gt;Barsathi 7 6 42&lt;BR /&gt;Bhitargaon 15 30 450&lt;BR /&gt;Bilhaur 26 63 1638&lt;BR /&gt;Chaubepur 20 45 900&lt;BR /&gt;Dharampur 27 66 1782&lt;BR /&gt;Dobhi 10 15 150&lt;BR /&gt;Ghatampur 15 30 450&lt;BR /&gt;Kakwan 17 36 612&lt;BR /&gt;Kalyanpur 20 45 900&lt;BR /&gt;Karanjakala 80 225 18000&lt;BR /&gt;KHUTHAN 8 9 72&lt;BR /&gt;Mahrajganj 34 87 2958&lt;BR /&gt;Mariahu 18 39 702&lt;BR /&gt;Rampur 7 6 42&lt;BR /&gt;Shahganj 66 183 12078&lt;BR /&gt;Shivrajpur 20 45 900&lt;BR /&gt;Sikrara 19 42 798&lt;BR /&gt;Sirkoni 30 75 2250&lt;BR /&gt;SUITHAKALA 12 21 252&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH,&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2017 17:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323165#M71589</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-01-07T17:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323203#M71595</link>
      <description>Thank you sir, but&lt;BR /&gt;It's not working .</description>
      <pubDate>Sun, 08 Jan 2017 08:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323203#M71595</guid>
      <dc:creator>pankajdev0027</dc:creator>
      <dc:date>2017-01-08T08:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323210#M71598</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/121196"&gt;@pankajdev0027&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;What you want to do must be quite simple to achieve but as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12151"&gt;@Jagadishkatam&lt;/a&gt;&amp;nbsp;points out your narrative of the problem doesn't match with the data you've provided. You need to clarify.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the solution&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&amp;nbsp;provided doesn't fit your requirements then just writing "it's not working" is insufficient. You need to explain what's not working as this will help us to understand what you're actually after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again: Your problem won't be hard to solve. It's all about you explaining us clearly what you have and what you need in order to enable us to provide a working solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 11:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323210#M71598</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-01-08T11:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323211#M71599</link>
      <description>Hi Patrick,&lt;BR /&gt;&lt;BR /&gt;Apologies,&lt;BR /&gt;I am uploading the solution in R programming can you convert it in SAS.</description>
      <pubDate>Sun, 08 Jan 2017 11:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323211#M71599</guid>
      <dc:creator>pankajdev0027</dc:creator>
      <dc:date>2017-01-08T11:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323212#M71600</link>
      <description>&lt;P&gt;Here is the solution but in R programming. So can you please change it to SAS programming.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Block &amp;lt;- c("Badlapur","Barsathi","Bhitargaon","Bilhaur","Chaubepur","Dharampur",&lt;BR /&gt;"Dobhi","Ghatampur","Kakwan","Kalyanpur","Karanjakala","KHUTHAN",&lt;BR /&gt;"Mahrajganj","Mariahu","Rampur","Shahganj","Shivrajpur","Sikrara",&lt;BR /&gt;"Sirkoni","SUITHAKALA")&lt;/P&gt;&lt;P&gt;NoA &amp;lt;- c(6,7,15,26,20,27,10,15,17,20,80,8,34,18,7,66,20,19,30,12)&lt;/P&gt;&lt;P&gt;NoV &amp;lt;- c(3,6,30,63,45,66,15,30,36,45,225,9,87,39,6,183,45,42,75,21)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for(m in 1:20){&lt;BR /&gt;a &amp;lt;- NoA[m]&lt;BR /&gt;b &amp;lt;- NoV[m]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;for(j in 1:a){&lt;BR /&gt;for(i in 1:b){&lt;BR /&gt;&lt;BR /&gt;print(paste0(Block[m],j,"_",i))&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 11:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323212#M71600</guid>
      <dc:creator>pankajdev0027</dc:creator>
      <dc:date>2017-01-08T11:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323213#M71601</link>
      <description>&lt;P&gt;I personally don't have R skills but there are quite a few very capable and experienced members in this forum so I'm sure posting existing R code logic will help to illustrate what you're after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 11:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323213#M71601</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-01-08T11:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323217#M71603</link>
      <description>&lt;P&gt;The code I suggested does the same thing as your R code. You never mentioned what form of output you wanted. If you want the same kind of output that you get from your R code, you simply have to add one more proc step, namely:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data=want noobs;&lt;BR /&gt; var id;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2017 15:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-generate-IDs/m-p/323217#M71603</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-01-08T15:01:15Z</dc:date>
    </item>
  </channel>
</rss>

