<?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 Proc Transpose Error - ID Value Occurs Twice in the Same Group in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-Error-ID-Value-Occurs-Twice-in-the-Same-Group/m-p/199356#M49835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am very close to a final solution in trying to dichotomize my words and phrases based on a listing. I am also supplying screen shots to help identify what is happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are some assorted comments and their claim numbers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Comments.JPG" class="jive-image" height="99" src="https://communities.sas.com/legacyfs/online/10723_Comments.JPG" width="302" /&gt;&lt;/P&gt;&lt;P&gt;Below are the words and phrases that I am searching for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Text4Matches.JPG" class="jive-image" height="289" src="https://communities.sas.com/legacyfs/online/10724_Text4Matches.JPG" width="244" /&gt;&lt;/P&gt;&lt;P&gt;I made a numeric column associated with each of these words and phrases. The goal is to eventually get a bunch of new dichotomous variables (Boolean indicators) if the word or phrase appears in a particular comment. Originally I wanted to do it so that the actual word or phrase is appended to the end of these new "flag" variables, but that was plagued by problems. Below is sort of a shot in how the final data will look:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FinalOutputShouldLookLike.JPG" class="jive-image-thumbnail jive-image" height="100" src="https://communities.sas.com/legacyfs/online/10725_FinalOutputShouldLookLike.JPG" width="308" /&gt;&lt;/P&gt;&lt;P&gt;The last columnn is from my NumberForLabels column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the following are some of the errors I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Errors.JPG" class="jive-image-thumbnail jive-image" height="40" src="https://communities.sas.com/legacyfs/online/10726_Errors.JPG" width="352" /&gt;&lt;/P&gt;&lt;P&gt;My code appears below. Perhaps my proc sql routine is not making the data unique in some way? I am sure there is a simple solution to this- any and all help is highly valued and appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp; create table scoresL as&lt;BR /&gt;&amp;nbsp; select CLAIMNO, COMMENTTEXT, Text4Matching, NumberForLabels&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SRS_Comments500 inner join &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextFromExcel on indexw(COMMENTTEXT, Text4Matching)&amp;gt;0&lt;BR /&gt;&amp;nbsp; order by CLAIMNO, COMMENTTEXT, Text4Matching;&lt;BR /&gt;quit;&lt;BR /&gt;proc print data=scoresL noobs; run;&lt;/P&gt;&lt;P&gt;proc transpose data=scoresL out=FlaggedCommentsT(drop=_:) prefix=flag_;&lt;BR /&gt;&amp;nbsp; by CLAIMNO;&lt;BR /&gt;&amp;nbsp; id NumberForLabels;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=FlaggedCommentsT noobs; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Jun 2015 20:42:23 GMT</pubDate>
    <dc:creator>Zachary</dc:creator>
    <dc:date>2015-06-03T20:42:23Z</dc:date>
    <item>
      <title>Proc Transpose Error - ID Value Occurs Twice in the Same Group</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-Error-ID-Value-Occurs-Twice-in-the-Same-Group/m-p/199356#M49835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am very close to a final solution in trying to dichotomize my words and phrases based on a listing. I am also supplying screen shots to help identify what is happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below are some assorted comments and their claim numbers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Comments.JPG" class="jive-image" height="99" src="https://communities.sas.com/legacyfs/online/10723_Comments.JPG" width="302" /&gt;&lt;/P&gt;&lt;P&gt;Below are the words and phrases that I am searching for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Text4Matches.JPG" class="jive-image" height="289" src="https://communities.sas.com/legacyfs/online/10724_Text4Matches.JPG" width="244" /&gt;&lt;/P&gt;&lt;P&gt;I made a numeric column associated with each of these words and phrases. The goal is to eventually get a bunch of new dichotomous variables (Boolean indicators) if the word or phrase appears in a particular comment. Originally I wanted to do it so that the actual word or phrase is appended to the end of these new "flag" variables, but that was plagued by problems. Below is sort of a shot in how the final data will look:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FinalOutputShouldLookLike.JPG" class="jive-image-thumbnail jive-image" height="100" src="https://communities.sas.com/legacyfs/online/10725_FinalOutputShouldLookLike.JPG" width="308" /&gt;&lt;/P&gt;&lt;P&gt;The last columnn is from my NumberForLabels column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the following are some of the errors I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Errors.JPG" class="jive-image-thumbnail jive-image" height="40" src="https://communities.sas.com/legacyfs/online/10726_Errors.JPG" width="352" /&gt;&lt;/P&gt;&lt;P&gt;My code appears below. Perhaps my proc sql routine is not making the data unique in some way? I am sure there is a simple solution to this- any and all help is highly valued and appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;&amp;nbsp; create table scoresL as&lt;BR /&gt;&amp;nbsp; select CLAIMNO, COMMENTTEXT, Text4Matching, NumberForLabels&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SRS_Comments500 inner join &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TextFromExcel on indexw(COMMENTTEXT, Text4Matching)&amp;gt;0&lt;BR /&gt;&amp;nbsp; order by CLAIMNO, COMMENTTEXT, Text4Matching;&lt;BR /&gt;quit;&lt;BR /&gt;proc print data=scoresL noobs; run;&lt;/P&gt;&lt;P&gt;proc transpose data=scoresL out=FlaggedCommentsT(drop=_:) prefix=flag_;&lt;BR /&gt;&amp;nbsp; by CLAIMNO;&lt;BR /&gt;&amp;nbsp; id NumberForLabels;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=FlaggedCommentsT noobs; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 20:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-Error-ID-Value-Occurs-Twice-in-the-Same-Group/m-p/199356#M49835</guid>
      <dc:creator>Zachary</dc:creator>
      <dc:date>2015-06-03T20:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose Error - ID Value Occurs Twice in the Same Group</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-Error-ID-Value-Occurs-Twice-in-the-Same-Group/m-p/199357#M49836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you need to go back to the logic involved in assigning NumberForLabels if you are getting multiple values within CLAIMNO. Possibly the source data had the CLAIMNO split somehow so that your approach process pieces separately resulting in duplicate values for NumberForLabels with different meanings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A crude investigative technique would be to take those values with errors and subset the data on them and sort by NumberForLabels and Claimno and see if you have multiple text values associated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that a fix might involve and earlier SORT by CLAIMNO.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2015 22:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-Error-ID-Value-Occurs-Twice-in-the-Same-Group/m-p/199357#M49836</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-06-03T22:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Transpose Error - ID Value Occurs Twice in the Same Group</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-Error-ID-Value-Occurs-Twice-in-the-Same-Group/m-p/199358#M49837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much. It was an issue where I had text for multiple comments per single claim. This created the situation of multiple ids per by variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I stripped the text comments from the file and removed the redundant codes all is working out. Thank you again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jun 2015 15:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Transpose-Error-ID-Value-Occurs-Twice-in-the-Same-Group/m-p/199358#M49837</guid>
      <dc:creator>Zachary</dc:creator>
      <dc:date>2015-06-04T15:48:44Z</dc:date>
    </item>
  </channel>
</rss>

