<?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 HOW TO FIND 1ST NAME 2ND NAME AND SO ON...? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-FIND-1ST-NAME-2ND-NAME-AND-SO-ON/m-p/613892#M179368</link>
    <description>&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input name$30.;&lt;BR /&gt;cards;&lt;BR /&gt;sai,priya,kunta,reddy,mskhdk&lt;BR /&gt;sgrav,mahesg,pitre,pedda&lt;BR /&gt;kiran,mami,chinna&lt;BR /&gt;ajay,kumar&lt;BR /&gt;divya&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this data&amp;nbsp; first i need use countw(name),then we will get the values of higher word name i.e 5 from our data&lt;/P&gt;&lt;P&gt;then i will use array.. like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array kiran(5) $ name1-name5;&lt;/P&gt;&lt;P&gt;do i =1 to 5;&lt;/P&gt;&lt;P&gt;kiran(i) =scan(name,i,',');&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;By doing this we will get&amp;nbsp;&lt;/P&gt;&lt;P&gt;name1 name2.............name5&lt;/P&gt;&lt;P&gt;sai&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; priya...............mskhdk&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;like that we will get exact data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;by using countw function we can find maxnumber of words then have to follow array&lt;/P&gt;&lt;P&gt;But here i dont know how many maxwords are their in variable i want above data using array only;&lt;/P&gt;&lt;P&gt;i what the above output in single data step..&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Dec 2019 12:48:52 GMT</pubDate>
    <dc:creator>Saikiran_Mamidi</dc:creator>
    <dc:date>2019-12-26T12:48:52Z</dc:date>
    <item>
      <title>HOW TO FIND 1ST NAME 2ND NAME AND SO ON...?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-FIND-1ST-NAME-2ND-NAME-AND-SO-ON/m-p/613892#M179368</link>
      <description>&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input name$30.;&lt;BR /&gt;cards;&lt;BR /&gt;sai,priya,kunta,reddy,mskhdk&lt;BR /&gt;sgrav,mahesg,pitre,pedda&lt;BR /&gt;kiran,mami,chinna&lt;BR /&gt;ajay,kumar&lt;BR /&gt;divya&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this data&amp;nbsp; first i need use countw(name),then we will get the values of higher word name i.e 5 from our data&lt;/P&gt;&lt;P&gt;then i will use array.. like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array kiran(5) $ name1-name5;&lt;/P&gt;&lt;P&gt;do i =1 to 5;&lt;/P&gt;&lt;P&gt;kiran(i) =scan(name,i,',');&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;By doing this we will get&amp;nbsp;&lt;/P&gt;&lt;P&gt;name1 name2.............name5&lt;/P&gt;&lt;P&gt;sai&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; priya...............mskhdk&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;like that we will get exact data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;by using countw function we can find maxnumber of words then have to follow array&lt;/P&gt;&lt;P&gt;But here i dont know how many maxwords are their in variable i want above data using array only;&lt;/P&gt;&lt;P&gt;i what the above output in single data step..&lt;/P&gt;&lt;P&gt;many thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 12:48:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-FIND-1ST-NAME-2ND-NAME-AND-SO-ON/m-p/613892#M179368</guid>
      <dc:creator>Saikiran_Mamidi</dc:creator>
      <dc:date>2019-12-26T12:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO FIND 1ST NAME 2ND NAME AND SO ON...?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-FIND-1ST-NAME-2ND-NAME-AND-SO-ON/m-p/613894#M179370</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304446"&gt;@Saikiran_Mamidi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;by using countw function we can find maxnumber of words then have to follow array&lt;/P&gt;
&lt;P&gt;But here i dont know how many maxwords are their in variable i want above data using array only;&lt;/P&gt;
&lt;P&gt;i what the above output in single data step..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I consider these restrictions to be inappropriate and unnecessary, and so I don't see why you can't do it using two data steps, or not using arrays.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The obvious method is to pass through the data once, obtain the maximum number of words in a given record. Then in the second data step you know how big to make the array. Now if the data set is so HUGE that passing through it twice is not a good idea, then you are stuck with solutions that will be inefficient anyway, such as setting the array size to some large number (such as 20) even when there may only be 6 names in a row, but you won't know that 6 is the number until you pass through the data, and you can't take the risk of having an array size that is too small.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 12:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-FIND-1ST-NAME-2ND-NAME-AND-SO-ON/m-p/613894#M179370</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-26T12:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO FIND 1ST NAME 2ND NAME AND SO ON...?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-FIND-1ST-NAME-2ND-NAME-AND-SO-ON/m-p/613907#M179379</link>
      <description>&lt;P&gt;I should add that maybe some of the SAS Communities Hash experts can do this in a single data step; but without using hash objects I don't think it is possible.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 15:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-FIND-1ST-NAME-2ND-NAME-AND-SO-ON/m-p/613907#M179379</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-26T15:05:44Z</dc:date>
    </item>
  </channel>
</rss>

