<?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: u warning in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508291#M136503</link>
    <description>&lt;P&gt;Fix your data first.&amp;nbsp; That date is incorrect.&amp;nbsp; ISO dates have a specific format, this will make your life easier.&amp;nbsp; Read up on the sdtm domain from CDISC, which as an industry, we should all be working with.&lt;/P&gt;
&lt;P&gt;As for duplicate:&lt;/P&gt;
&lt;PRE&gt;data want;
  set lb;
  by usubjid lbdtc;
  if first.lbdtc and not(last.lbdtc) then dup_flg="Y";
run;&lt;/PRE&gt;
&lt;P&gt;Although I suspect you have lbtestcd and other variables to by group on as well.&lt;/P&gt;</description>
    <pubDate>Mon, 29 Oct 2018 10:28:37 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-10-29T10:28:37Z</dc:date>
    <item>
      <title>u warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508277#M136490</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;this is my detaset i want to create u warning that this dataset having duplicare record.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data lb;&lt;BR /&gt;input usubjid lbdtc $ 16. lbtptnum rbc wbc visit;&lt;BR /&gt;cards;&lt;BR /&gt;101 01-10-2018t10:15 1 1 1 1 86&lt;BR /&gt;101 01-10-2018t10:20 2 2 2 1.01&lt;BR /&gt;101 01-10-2018t10:20 2 2 2 1.01&lt;BR /&gt;;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 09:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508277#M136490</guid>
      <dc:creator>ravindra2</dc:creator>
      <dc:date>2018-10-29T09:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: u warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508280#M136493</link>
      <description>&lt;P&gt;Use SQL to get a count, and then proceed from that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select max(count) into :count from (select count(*) as count from lb group by usubjid,lbdtc,lbtptnum,rbc,wbc,visit);
quit;

data _null_;
if &amp;amp;count &amp;gt; 1 then put "WARNING";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2018 09:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508280#M136493</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-29T09:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: u warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508282#M136495</link>
      <description>&lt;P&gt;can you please give me same thing in datastep&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 09:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508282#M136495</guid>
      <dc:creator>ravindra2</dc:creator>
      <dc:date>2018-10-29T09:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: u warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508283#M136496</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I don't understand "u warning", but how about this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lb;
input usubjid lbdtc $ 16. lbtptnum rbc wbc visit;
cards;
101 01-10-2018t10:15 1 1 1 1 86
101 01-10-2018t10:20 2 2 2 1.01
101 01-10-2018t10:20 2 2 2 1.01
;
run;
proc sort data=lb nodupkey dupout=dup;
    by usubjid lbdtc lbtptnum rbc wbc visit;
run;
data _null_;
    set dup;
    call symputx("nobs", &amp;amp;sysnobs.);
run;
%macro chkobs;
data _null_;
    set dup;
    %if &amp;amp;&amp;amp;nobs. eq 0 %then %put ;
    %else %if &amp;amp;&amp;amp;nobs. ne 0 %then %put %sysfunc(cats(WAR, NING:));
%mend chkobs;
%chkobs&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2018 09:41:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508283#M136496</guid>
      <dc:creator>KentaMURANAKA</dc:creator>
      <dc:date>2018-10-29T09:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: u warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508285#M136498</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/204979"&gt;@KentaMURANAKA&lt;/a&gt;!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    set dup;
    call symputx("nobs", &amp;amp;sysnobs.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If dup is empty, the call symputx will never execute. The set is not necessary.&lt;/P&gt;
&lt;P&gt;If you do want to use &lt;FONT face="courier new,courier"&gt;set dup&lt;/FONT&gt;, do it this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    call symputx("nobs", nobs);
    set dup nobs=nobs;&lt;BR /&gt;    stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The call symputx() is now executed before the EOF condition is encountered by the set statement, and only one data step iteration is run.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 09:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508285#M136498</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-29T09:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: u warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508291#M136503</link>
      <description>&lt;P&gt;Fix your data first.&amp;nbsp; That date is incorrect.&amp;nbsp; ISO dates have a specific format, this will make your life easier.&amp;nbsp; Read up on the sdtm domain from CDISC, which as an industry, we should all be working with.&lt;/P&gt;
&lt;P&gt;As for duplicate:&lt;/P&gt;
&lt;PRE&gt;data want;
  set lb;
  by usubjid lbdtc;
  if first.lbdtc and not(last.lbdtc) then dup_flg="Y";
run;&lt;/PRE&gt;
&lt;P&gt;Although I suspect you have lbtestcd and other variables to by group on as well.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 10:28:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508291#M136503</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-29T10:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: u warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508308#M136508</link>
      <description>&lt;P&gt;If you get this data by reading from a file, and you know the file is sorted, you can do it like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lb;
input usubjid lbdtc $ 16. lbtptnum rbc wbc visit;
if _infile_=lag(_infile_) then do;
  error 'Duplicate record';
  delete;
  end;
cards;
101 01-10-2018t10:15 1 1 1 1 86
101 01-10-2018t10:20 2 2 2 1.01
101 01-10-2018t10:20 2 2 2 1.01
;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I used ERROR rather than writing a warning, because the ERROR statement will dump all variables in the log.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 11:56:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508308#M136508</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-10-29T11:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: u warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508543#M136587</link>
      <description>&lt;P&gt;Hi, Mr. KurtBremser:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for correcting my code. I agree with you. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 23:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/u-warning/m-p/508543#M136587</guid>
      <dc:creator>KentaMURANAKA</dc:creator>
      <dc:date>2018-10-29T23:36:43Z</dc:date>
    </item>
  </channel>
</rss>

