<?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: just the two syntax in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14607#M2378</link>
    <description>thank you for seeing my topic...&lt;BR /&gt;
&lt;BR /&gt;
my output would be in a html format report... all i want is a select statement that can output a condition of asm_type = '900' and asm_type = '905' and not anything else.... even-though an id contains the '900' and '905' as its first two asm type, and if it has a third asm type, I would neglect the id all together... I am very new at sas, I hope my explanation is good enuf... &lt;BR /&gt;
&lt;BR /&gt;
regards</description>
    <pubDate>Tue, 10 Nov 2009 08:21:23 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-11-10T08:21:23Z</dc:date>
    <item>
      <title>just the two syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14605#M2376</link>
      <description>hello all... I have value as follow &lt;BR /&gt;
&lt;BR /&gt;
type | seq | id&lt;BR /&gt;
&lt;BR /&gt;
900 | 1 | 12345      &lt;BR /&gt;
905 | 2 | 12345&lt;BR /&gt;
166 | 3 | 12345&lt;BR /&gt;
900 | 1 | 90171&lt;BR /&gt;
905 | 2 | 90171&lt;BR /&gt;
900 | 1 | 11145&lt;BR /&gt;
905 | 2 | 11145&lt;BR /&gt;
105 | 3 | 11145&lt;BR /&gt;
&lt;BR /&gt;
what is my syntax should I want to output id for the asm_type only in 900, and 905 so in this case, the syntax would output 90171 only and count it as 1.&lt;BR /&gt;
&lt;BR /&gt;
any help on this is greatly appreciated&lt;BR /&gt;
&lt;BR /&gt;
thanks&lt;BR /&gt;
regards...&lt;BR /&gt;
neobita</description>
      <pubDate>Tue, 10 Nov 2009 06:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14605#M2376</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-10T06:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: just the two syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14606#M2377</link>
      <description>I'm not exactly clear how you want your output (best is to show an example output table as well).&lt;BR /&gt;
Maybe PROC SORT NODUPKEY/PROC SQL Select Distinct with a WHERE-clause will do your job...?&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Tue, 10 Nov 2009 08:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14606#M2377</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-11-10T08:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: just the two syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14607#M2378</link>
      <description>thank you for seeing my topic...&lt;BR /&gt;
&lt;BR /&gt;
my output would be in a html format report... all i want is a select statement that can output a condition of asm_type = '900' and asm_type = '905' and not anything else.... even-though an id contains the '900' and '905' as its first two asm type, and if it has a third asm type, I would neglect the id all together... I am very new at sas, I hope my explanation is good enuf... &lt;BR /&gt;
&lt;BR /&gt;
regards</description>
      <pubDate>Tue, 10 Nov 2009 08:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14607#M2378</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-11-10T08:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: just the two syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14608#M2379</link>
      <description>data one;&lt;BR /&gt;
input type seq id;&lt;BR /&gt;
cards;&lt;BR /&gt;
900 1 12345&lt;BR /&gt;
905 2 12345&lt;BR /&gt;
166 3 12345&lt;BR /&gt;
900 1 90171&lt;BR /&gt;
905 2 90171&lt;BR /&gt;
900 1 11145&lt;BR /&gt;
905 2 11145&lt;BR /&gt;
105 3 11145&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table two as select distinct id, type from one where id not in (select id from one where&lt;BR /&gt;
   seq GE 3);&lt;BR /&gt;
quit;</description>
      <pubDate>Tue, 10 Nov 2009 14:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14608#M2379</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-11-10T14:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: just the two syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14609#M2380</link>
      <description>it seems that I'm still unable to get the result I wanted. I want to output the ID with ASSET 900 for SEQ 1 and ID with ASSET 905 for SEQ 2 as a single ID and without a third SEQ&lt;BR /&gt;
&lt;BR /&gt;
inside the database, it shows the following data.&lt;BR /&gt;
&lt;BR /&gt;
ID----------------YEAR-----------TYP----------ASSET--------SEQ&lt;BR /&gt;
76039803------2006--------------1---------------900-------------1 &lt;BR /&gt;
76039803------2006--------------1---------------905-------------2 &lt;BR /&gt;
77318706------2006--------------1---------------900-------------1 &lt;BR /&gt;
77318706------2006--------------1---------------905-------------2 &lt;BR /&gt;
86856104------2006--------------1---------------900-------------1 &lt;BR /&gt;
86856104------2006--------------1---------------905-------------2 &lt;BR /&gt;
88458302------2006--------------1---------------900-------------1 &lt;BR /&gt;
88458302------2006--------------1---------------905-------------2 &lt;BR /&gt;
200180480-----2006--------------1---------------900-------------1 &lt;BR /&gt;
200180480-----2006--------------1---------------905-------------2 &lt;BR /&gt;
276493707-----2006--------------1---------------900-------------1 &lt;BR /&gt;
276493707-----2006--------------1---------------905-------------2 &lt;BR /&gt;
687509501-----2006--------------1---------------105-------------3 &lt;BR /&gt;
687509501-----2006--------------1---------------900-------------1 &lt;BR /&gt;
687509501-----2006--------------1---------------905-------------2 &lt;BR /&gt;
123123123-----2006--------------1---------------900-------------0 &lt;BR /&gt;
123123123-----2006--------------1---------------905-------------1 &lt;BR /&gt;
88888888------2006--------------1---------------900-------------1 &lt;BR /&gt;
88888888------2006--------------1---------------123-------------2 &lt;BR /&gt;
99999999------2006--------------1---------------111-------------1 &lt;BR /&gt;
99999999------2006--------------1---------------905-------------2 &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The id that I want would be 076039803, 077318706 , 086856104 , 088458302 , 2001804807 and 276493707.&lt;BR /&gt;
&lt;BR /&gt;
I Don't want the following ID&lt;BR /&gt;
687509501 - because it contains more than 2 seq&lt;BR /&gt;
123123123 - because it starts with seq 0&lt;BR /&gt;
88888888 - because the second sequence ASSET is 123&lt;BR /&gt;
99999999 - because the first sequence ASSET is 111&lt;BR /&gt;
&lt;BR /&gt;
kindly share some light to this humble programmer.... any help given is truly appreciated,&lt;BR /&gt;
&lt;BR /&gt;
regards&lt;BR /&gt;
neobita</description>
      <pubDate>Fri, 22 Jan 2010 04:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14609#M2380</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-01-22T04:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: just the two syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14610#M2381</link>
      <description>Hi.&lt;BR /&gt;
&lt;BR /&gt;
Try this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
* ensure data is sorted;&lt;BR /&gt;
proc sort data=INDATA; &lt;BR /&gt;
by ID;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data OUTDATA;&lt;BR /&gt;
set INDATA;&lt;BR /&gt;
by ID;&lt;BR /&gt;
retain _GOOD; * flag;&lt;BR /&gt;
keep ID;&lt;BR /&gt;
if first.ID then _GOOD=1; * assume its a good ID;&lt;BR /&gt;
if SEQ not in (1,2) or ASSET not in (900,905) then _GOOD=0; * fails;&lt;BR /&gt;
if last.ID and _GOOD; * output last obs if good ID;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Works with your sample, but please do some more intensive tests.&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Fri, 22 Jan 2010 08:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14610#M2381</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2010-01-22T08:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: just the two syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14611#M2382</link>
      <description>data one;&lt;BR /&gt;
input type seq id;&lt;BR /&gt;
cards;&lt;BR /&gt;
900 1 12345&lt;BR /&gt;
905 2 12345&lt;BR /&gt;
166 3 12345&lt;BR /&gt;
900 1 90171&lt;BR /&gt;
905 2 90171&lt;BR /&gt;
900 1 11145&lt;BR /&gt;
905 2 11145&lt;BR /&gt;
105 3 11145&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
 create table justtwo as&lt;BR /&gt;
  select distinct id  from one &lt;BR /&gt;
  group by id&lt;BR /&gt;
  having count(id)  =2 ;&lt;BR /&gt;
quit;</description>
      <pubDate>Fri, 22 Jan 2010 16:19:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14611#M2382</guid>
      <dc:creator>abdullala</dc:creator>
      <dc:date>2010-01-22T16:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: just the two syntax</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14612#M2383</link>
      <description>[pre]data two ;&lt;BR /&gt;
  do row=1 by 1 until( last.id ) ;&lt;BR /&gt;
    set origs ;&lt;BR /&gt;
    by id notsorted ;&lt;BR /&gt;
    if asset = '900' and seq=1 then f1='1' ;&lt;BR /&gt;
    if asset = '905' and seq=2 then f2='1' ;&lt;BR /&gt;
    else f3= '1' ;&lt;BR /&gt;
  end ; &lt;BR /&gt;
  if f3 ne '1' and f1!!f2 = '11' then output ;&lt;BR /&gt;
run;[/pre]</description>
      <pubDate>Fri, 22 Jan 2010 16:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/just-the-two-syntax/m-p/14612#M2383</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-01-22T16:39:08Z</dc:date>
    </item>
  </channel>
</rss>

