<?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: Correcting Dose Order in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183360#M34834</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I lost my code &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; so am recreating but am getting the following error which I didn't get before. Using proc contents, the two variables with 'var' in their name are both numeric, date9. variables.&amp;nbsp; Why am I getting this error?&amp;nbsp; Any help you can give is much appreciated!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1427&amp;nbsp; *--correct varicella dose order;&lt;/P&gt;&lt;P&gt;1428&lt;/P&gt;&lt;P&gt;1429&amp;nbsp; array v{*} var:;&lt;/P&gt;&lt;P&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;/P&gt;&lt;P&gt;1430&lt;/P&gt;&lt;P&gt;1431&amp;nbsp; call sortn(of v{*});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -----&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 731&lt;/P&gt;&lt;P&gt;WARNING 731-185: Argument #4 is a character variable, while a numeric variable must be passed to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the SORTN subroutine call in order for the variable to be updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1432&lt;/P&gt;&lt;P&gt;1433&amp;nbsp; n = nmiss(of v{*});&lt;/P&gt;&lt;P&gt;1434&lt;/P&gt;&lt;P&gt;1435&amp;nbsp; do i = 1 to dim(v)-n;&lt;/P&gt;&lt;P&gt;1436&lt;/P&gt;&lt;P&gt;1437&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v{i} = v{i+n};&lt;/P&gt;&lt;P&gt;1438&lt;/P&gt;&lt;P&gt;1439&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;1440&lt;/P&gt;&lt;P&gt;1441&amp;nbsp; do i = 1 to n;&lt;/P&gt;&lt;P&gt;1442&lt;/P&gt;&lt;P&gt;1443&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing(v{dim(v)-i+1});&lt;/P&gt;&lt;P&gt;1444&lt;/P&gt;&lt;P&gt;1445&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;1446&lt;/P&gt;&lt;P&gt;1447&amp;nbsp; drop i n;&lt;/P&gt;&lt;P&gt;1448&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Aug 2014 16:18:12 GMT</pubDate>
    <dc:creator>jcis7</dc:creator>
    <dc:date>2014-08-22T16:18:12Z</dc:date>
    <item>
      <title>Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183350#M34824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;G'day.&lt;/P&gt;&lt;P&gt;I have a large file (&amp;gt;5000 obs). Each child has immunization doses for they childhood vaccines they received.&lt;/P&gt;&lt;P&gt;I inherited a data checking program that identifies which doses in the dose series (i.e, 3 Hepatitis B Doses required) are out of order.&lt;/P&gt;&lt;P&gt;How do I get the dates in order (earlier date first, later date next, and latest date last:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;school&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childnum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hepb1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hepb2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hepb3&lt;/P&gt;&lt;P&gt;P001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/25/2008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/24/2007&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 07/25/2008&amp;nbsp;&amp;nbsp;&amp;nbsp; (this should be hepb1:&amp;nbsp; 10/24/2007, hepb2:&amp;nbsp; 01/25/2008, hepb3:&amp;nbsp; 07/25/2008)&lt;/P&gt;&lt;P&gt;P001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10/11/2008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 07/10/2008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 04/10/2007&amp;nbsp; (this should be: hepb1:&amp;nbsp; 04/10/2007, hepb2:&amp;nbsp; 07/10/2008, hepb3:&amp;nbsp; 10/11/2008)&lt;/P&gt;&lt;P&gt;P002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/15/2007&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/15/2008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/11/2008&amp;nbsp; (this should be: hepb1:&amp;nbsp; as is, hepb2:&amp;nbsp; 02/11/2008, hepb3:&amp;nbsp; 05/15/2008)&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help you can give is much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 16:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183350#M34824</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2014-06-03T16:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183351#M34825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use call routine SORTN :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input school $ childnum (hepb1 hepb2 hepb3) (:mmddyy10.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;format hepb1-hepb3 yymmdd.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P001 001 01/25/2008 10/24/2007 07/25/2008&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P001 002 10/11/2008 07/10/2008 04/10/2007&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P002 001 11/15/2007 05/15/2008 02/11/2008&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call sortn(of hepb1-hepb3);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print data=want noobs; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 16:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183351#M34825</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-06-03T16:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183352#M34826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works except I have blank values for some vaccines. For example if the last dose of Hepb is blank, it places the blank value first.&amp;nbsp; How do you sort while keeping any blank values last (i.e, if hepb3 is blank, for it to sort with hepb3 as being blank. Right now, it's sorting with hepb1 as blank). &lt;/P&gt;&lt;P&gt;For some children, they're missing 2 doses of hepb.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 17:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183352#M34826</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2014-06-03T17:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183353#M34827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A little tweak on PG's code should do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input school $ childnum (hepb1 hepb2 hepb3) (:mmddyy10.);&lt;/P&gt;&lt;P&gt;format hepb1-hepb3 yymmdd.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;P001 001 01/25/2008 10/24/2007 07/25/2008&lt;/P&gt;&lt;P&gt;P001 002 . 07/10/2008 04/10/2007&lt;/P&gt;&lt;P&gt;P002 001 11/15/2007 . 02/11/2008&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array h hepb:;&lt;/P&gt;&lt;P&gt;retain _d;&lt;/P&gt;&lt;P&gt;if _n_=1 then _d=dim(h);&lt;/P&gt;&lt;P&gt;do i=1 to _d;&lt;/P&gt;&lt;P&gt;&amp;nbsp; h(i)=coalesce(h(i),'31dec9999'd);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;call sortn(of h(*));&lt;/P&gt;&lt;P&gt;if h(_d) = '31dec9999'd then call missing (h(_d));&lt;/P&gt;&lt;P&gt;drop i _d;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=want noobs; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 18:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183353#M34827</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-06-03T18:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183354#M34828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also try this. Question is: how do you know this is just due to missing value or no injection for third time with sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;input school $ childnum (hepb1 hepb2 hepb3) (:mmddyy10.);&lt;BR /&gt;format hepb1-hepb3 yymmdd.;&lt;BR /&gt;datalines;&lt;BR /&gt;P001 001 01/25/2008 . 07/25/2008&lt;BR /&gt;P001 002 10/11/2008 07/10/2008 04/10/2007&lt;BR /&gt;P002 001 . 05/15/2008 02/11/2008&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want(rename=(h1-h3=hepb1-hepb3));&lt;BR /&gt;set have;&lt;BR /&gt;array h(3);&lt;BR /&gt;do i=1 to dim(h);&lt;BR /&gt;&amp;nbsp; h(i)=smallest(i,of hepb1-hepb3);&lt;BR /&gt;end;&lt;BR /&gt;format h1-h3 yymmdd.;&lt;BR /&gt;drop hepb: i;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 19:18:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183354#M34828</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2014-06-03T19:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183355#M34829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Appreciate your help; this sorts the dates in order for keeps the 31Dec9999 in the blank fields. How do I drop the 31Dec9999?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2014 22:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183355#M34829</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2014-06-03T22:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183356#M34830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another tweak, in which the dates are simply shifted down the array:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input school $ childnum (hepb1 hepb2 hepb3) (:mmddyy10.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;format hepb1-hepb3 yymmdd.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P001 001 01/25/2008 10/24/2007 07/25/2008&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P001 002 10/11/2008 07/10/2008 04/10/2007&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P002 001 11/15/2007 05/15/2008 02/11/2008&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P002 003 05/15/2008 . 02/11/2008&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P002 004 . . 02/11/2008&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;array h{*} hepb:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call sortn(of h{*});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;n = nmiss(of h{*});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do i = 1 to dim(h)-n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; h{i} = h{i+n};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do i = 1 to n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing(h{dim(h)-i+1});&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop i n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print data=want noobs; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 02:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183356#M34830</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-06-04T02:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183357#M34831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or don't use any function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
input school $ childnum (hepb1 hepb2 hepb3) (:mmddyy10.);
format hepb1-hepb3 yymmdd.;
datalines;
P001 001 01/25/2008 10/24/2007 07/25/2008
P001 002 10/11/2008 07/10/2008 04/10/2007
P002 001 11/15/2007 05/15/2008 02/11/2008
P002 003 05/15/2008 . 02/11/2008
P002 004 . . 02/11/2008
;
run;
data have;
 set have;
 array h{*} hepb:;
 do i=1 to dim(h)-1;
&amp;nbsp; do j=i+1 to dim(h);
&amp;nbsp;&amp;nbsp; if (h{i} &amp;gt; h{j} and not missing(h{j})) or missing(h{i}) then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp=h{j};h{j}=h{i};h{i}=temp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end;
end;
end;
drop i j temp;
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 13:30:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183357#M34831</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-06-04T13:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183358#M34832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 13:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183358#M34832</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-06-04T13:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183359#M34833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so very much everyone&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 16:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183359#M34833</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2014-06-05T16:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183360#M34834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I lost my code &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; so am recreating but am getting the following error which I didn't get before. Using proc contents, the two variables with 'var' in their name are both numeric, date9. variables.&amp;nbsp; Why am I getting this error?&amp;nbsp; Any help you can give is much appreciated!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1427&amp;nbsp; *--correct varicella dose order;&lt;/P&gt;&lt;P&gt;1428&lt;/P&gt;&lt;P&gt;1429&amp;nbsp; array v{*} var:;&lt;/P&gt;&lt;P&gt;ERROR: All variables in array list must be the same type, i.e., all numeric or character.&lt;/P&gt;&lt;P&gt;1430&lt;/P&gt;&lt;P&gt;1431&amp;nbsp; call sortn(of v{*});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -----&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 731&lt;/P&gt;&lt;P&gt;WARNING 731-185: Argument #4 is a character variable, while a numeric variable must be passed to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the SORTN subroutine call in order for the variable to be updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1432&lt;/P&gt;&lt;P&gt;1433&amp;nbsp; n = nmiss(of v{*});&lt;/P&gt;&lt;P&gt;1434&lt;/P&gt;&lt;P&gt;1435&amp;nbsp; do i = 1 to dim(v)-n;&lt;/P&gt;&lt;P&gt;1436&lt;/P&gt;&lt;P&gt;1437&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v{i} = v{i+n};&lt;/P&gt;&lt;P&gt;1438&lt;/P&gt;&lt;P&gt;1439&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;1440&lt;/P&gt;&lt;P&gt;1441&amp;nbsp; do i = 1 to n;&lt;/P&gt;&lt;P&gt;1442&lt;/P&gt;&lt;P&gt;1443&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call missing(v{dim(v)-i+1});&lt;/P&gt;&lt;P&gt;1444&lt;/P&gt;&lt;P&gt;1445&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;1446&lt;/P&gt;&lt;P&gt;1447&amp;nbsp; drop i n;&lt;/P&gt;&lt;P&gt;1448&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 16:18:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183360#M34834</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2014-08-22T16:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183361#M34835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would look for more variables that start with VAR than you expect, especially if you reimported the raw data.&lt;/P&gt;&lt;P&gt;post the full output of proc contents that you used.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 16:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183361#M34835</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-22T16:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Dose Order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183362#M34836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&amp;nbsp; I separated it out from another block of code and it now works!&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 17:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Correcting-Dose-Order/m-p/183362#M34836</guid>
      <dc:creator>jcis7</dc:creator>
      <dc:date>2014-08-22T17:07:17Z</dc:date>
    </item>
  </channel>
</rss>

