loishaggard Tracker
https://communities.sas.com/kntur85557/tracker
loishaggard TrackerSun, 15 Sep 2024 13:28:09 GMT2024-09-15T13:28:09ZRe: Syntax incorrect?
https://communities.sas.com/t5/SAS-Programming/Syntax-incorrect/m-p/743719#M232914
Yes. The UPCASE is something I added when I was experimenting with it. I implemented your suggestion, now.<BR /><BR />This code is using in a web-based query application. The front end passes name-values pairs to the back end C program in a URL. The C program reads the name-value pairs and plugs in values for variables like %cross1%.<BR /><BR />Thanks for your help.<BR /><BR />LTue, 25 May 2021 23:12:50 GMThttps://communities.sas.com/t5/SAS-Programming/Syntax-incorrect/m-p/743719#M232914loishaggard2021-05-25T23:12:50ZRe: Syntax incorrect?
https://communities.sas.com/t5/SAS-Programming/Syntax-incorrect/m-p/743710#M232907
Yes, pre-processing by a C program that is writing the SAS code.Tue, 25 May 2021 22:05:41 GMThttps://communities.sas.com/t5/SAS-Programming/Syntax-incorrect/m-p/743710#M232907loishaggard2021-05-25T22:05:41ZRe: Syntax incorrect?
https://communities.sas.com/t5/SAS-Programming/Syntax-incorrect/m-p/743691#M232891
Thanks. I thought the bang operator was "OR." But if it's combined with an equals sign it is "not equals".<BR /><BR />Go figure.<BR /><BR />Thanks.Tue, 25 May 2021 20:19:05 GMThttps://communities.sas.com/t5/SAS-Programming/Syntax-incorrect/m-p/743691#M232891loishaggard2021-05-25T20:19:05ZSyntax incorrect?
https://communities.sas.com/t5/SAS-Programming/Syntax-incorrect/m-p/743686#M232888
<P>I am looking at some SAS code that has these lines:</P><P> </P><P>%if UPCASE('%cross1%') <STRONG><FONT color="#FF00FF">!=</FONT></STRONG> 'YEAR' %then %do;<BR />if year_sflag<=0 then delete;<BR />%end;</P><P> </P><P>Does "<STRONG><FONT color="#FF00FF">!=</FONT></STRONG>" make sense? "or, equals"? It doesn't throw an error, but I can't imagine it is correct.</P><P> </P><P>Has anyone seen/used this expression? If so, what does it do?</P><P> </P><P>Thank you!</P><P> </P>Tue, 25 May 2021 19:58:35 GMThttps://communities.sas.com/t5/SAS-Programming/Syntax-incorrect/m-p/743686#M232888loishaggard2021-05-25T19:58:35ZRe: Filter records after a certain date found on another record
https://communities.sas.com/t5/SAS-Programming/Filter-records-after-a-certain-date-found-on-another-record/m-p/704817#M216094
<P>Thanks so much, everyone, But so far, no go.</P><P> </P><P>The mkeintz novinosrin so<SPAN style="font-family: inherit;">lutions deleted </SPAN><STRONG>appropriate</STRONG><SPAN style="font-family: inherit;"> records for any patient who had had a positive test, and also </SPAN><STRONG>all</STRONG><SPAN style="font-family: inherit;"> records for patients who had not had any positive test. Those latter records need to be maintained in the dataset.</SPAN></P><P> </P><P>The hhinohar solution yielded a dataset with 33 records with missing values for every variable on every record. There was a problem reading in PATIENT_ID. I'll look more into it.</P><P> </P><P>The solution, using the data provided, should delete the 18 records marked with "delete," yielding a dataset with 82 records. It should maintain all the records for patient ID that never had a positive result, as well as the records with the positive results, and the records for patients with a positive result for which the specimen was collected before the date of the positive result.</P><DIV class="branch"> </DIV><DIV class="branch">Thanks again for you efforts!</DIV>Wed, 09 Dec 2020 17:35:08 GMThttps://communities.sas.com/t5/SAS-Programming/Filter-records-after-a-certain-date-found-on-another-record/m-p/704817#M216094loishaggard2020-12-09T17:35:08ZRe: Filter records after a certain date found on another record
https://communities.sas.com/t5/SAS-Programming/Filter-records-after-a-certain-date-found-on-another-record/m-p/704598#M216011
Thanks. I'll give it a try!Wed, 09 Dec 2020 00:06:45 GMThttps://communities.sas.com/t5/SAS-Programming/Filter-records-after-a-certain-date-found-on-another-record/m-p/704598#M216011loishaggard2020-12-09T00:06:45ZFilter records after a certain date found on another record
https://communities.sas.com/t5/SAS-Programming/Filter-records-after-a-certain-date-found-on-another-record/m-p/704590#M216008
<P>I have test result data for patients. Once a patient tests positive (result=1) any future tests for that patient should be deleted from the file.</P><P> </P><P>So I know I need to identify the record with result=1 and grab that date, but I'm at a loss for how to apply that date within patient ID to delete records with a higher date value.</P><P> </P><P>Thanks in advance.</P><P> </P><TABLE><TBODY><TR><TD>PATIENT_ID</TD><TD>_SPECIMEN_COLL_DT</TD><TD>RESULT</TD><TD> </TD></TR><TR><TD>1007215</TD><TD>23-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1007215</TD><TD>25-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1007215</TD><TD>27-Sep-20</TD><TD>1</TD><TD> </TD></TR><TR><TD>1007215</TD><TD>1-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1007215</TD><TD>10-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1007215</TD><TD>14-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1007215</TD><TD>30-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1007215</TD><TD>6-Dec-20</TD><TD>9</TD><TD>delete</TD></TR><TR><TD>1342677</TD><TD>19-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1342677</TD><TD>7-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1345898</TD><TD>25-Aug-20</TD><TD>9</TD><TD> </TD></TR><TR><TD>1345898</TD><TD>27-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1345898</TD><TD>11-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1345898</TD><TD>23-Oct-20</TD><TD>1</TD><TD> </TD></TR><TR><TD>1345898</TD><TD>30-Oct-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1345898</TD><TD>6-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1345898</TD><TD>22-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1345898</TD><TD>29-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1345898</TD><TD>6-Dec-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1408252</TD><TD>21-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1439221</TD><TD>25-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1439245</TD><TD>8-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1442703</TD><TD>21-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1451575</TD><TD>24-Aug-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1451575</TD><TD>24-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1462769</TD><TD>9-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1469679</TD><TD>15-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1469679</TD><TD>3-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1469679</TD><TD>7-Oct-20</TD><TD>1</TD><TD> </TD></TR><TR><TD>1469679</TD><TD>3-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>1502202</TD><TD>17-Aug-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1502202</TD><TD>29-Aug-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1502202</TD><TD>19-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1502202</TD><TD>28-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1502202</TD><TD>13-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1502202</TD><TD>21-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1502202</TD><TD>6-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1557673</TD><TD>20-Aug-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1560593</TD><TD>30-Aug-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1569074</TD><TD>11-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1571807</TD><TD>15-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1602114</TD><TD>13-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1743463</TD><TD>7-Jul-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1751405</TD><TD>7-Jun-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1751737</TD><TD>14-Jul-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1760386</TD><TD>27-Jul-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>1760410</TD><TD>28-Jul-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2022188</TD><TD>8-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2076478</TD><TD>11-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2077550</TD><TD>6-Oct-20</TD><TD>3</TD><TD> </TD></TR><TR><TD>2078033</TD><TD>30-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2079325</TD><TD>5-Dec-20</TD><TD>9</TD><TD> </TD></TR><TR><TD>2081383</TD><TD>26-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2085676</TD><TD>24-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2086149</TD><TD>6-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2086958</TD><TD>4-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2088387</TD><TD>18-Sep-20</TD><TD>9</TD><TD> </TD></TR><TR><TD>2088387</TD><TD>17-Nov-20</TD><TD>1</TD><TD> </TD></TR><TR><TD>2088387</TD><TD>8-Dec-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>2093450</TD><TD>8-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2094033</TD><TD>28-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2094452</TD><TD>21-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2097616</TD><TD>29-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2111066</TD><TD>20-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2112099</TD><TD>18-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2114632</TD><TD>6-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2118460</TD><TD>25-Sep-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2118460</TD><TD>29-Sep-20</TD><TD>1</TD><TD> </TD></TR><TR><TD>2118460</TD><TD>10-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>2118460</TD><TD>20-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>2118460</TD><TD>26-Nov-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>2118460</TD><TD>4-Dec-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>2118460</TD><TD>6-Dec-20</TD><TD>2</TD><TD>delete</TD></TR><TR><TD>2133328</TD><TD>30-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2133571</TD><TD>13-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2134005</TD><TD>8-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2134473</TD><TD>29-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2153388</TD><TD>11-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2166498</TD><TD>20-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2167076</TD><TD>5-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168477</TD><TD>8-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168481</TD><TD>8-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168517</TD><TD>8-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168548</TD><TD>20-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168564</TD><TD>2-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168574</TD><TD>15-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168601</TD><TD>5-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168638</TD><TD>4-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2168642</TD><TD>6-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2169406</TD><TD>8-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2172274</TD><TD>21-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2172274</TD><TD>20-Nov-20</TD><TD>1</TD><TD> </TD></TR><TR><TD>2172274</TD><TD>4-Dec-20</TD><TD>9</TD><TD>delete</TD></TR><TR><TD>2174225</TD><TD>6-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2176363</TD><TD>14-Nov-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2177143</TD><TD>5-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2177326</TD><TD>8-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2178406</TD><TD>8-Dec-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2178412</TD><TD>5-Oct-20</TD><TD>2</TD><TD> </TD></TR><TR><TD>2178416</TD><TD>13-Nov-20</TD><TD>2</TD><TD> </TD></TR></TBODY></TABLE>Tue, 08 Dec 2020 23:43:29 GMThttps://communities.sas.com/t5/SAS-Programming/Filter-records-after-a-certain-date-found-on-another-record/m-p/704590#M216008loishaggard2020-12-08T23:43:29ZRe: filter by dates within by-group?
https://communities.sas.com/t5/SAS-Programming/filter-by-dates-within-by-group/m-p/677126#M204230
Perfect. You rock!Mon, 17 Aug 2020 01:11:42 GMThttps://communities.sas.com/t5/SAS-Programming/filter-by-dates-within-by-group/m-p/677126#M204230loishaggard2020-08-17T01:11:42Zfilter by dates within by-group?
https://communities.sas.com/t5/SAS-Programming/filter-by-dates-within-by-group/m-p/677122#M204227
<P>I need to filter out any lab reports that had a previous report for the same patient ID within the past 30 days. Here are the patient ID and date fields for a set of records, grouped by patient ID. As you can see, patient ID 0012304 had four lab reports. It looks like the one on July 23rd was the original report. Records for the other, later reports should be deleted because they are within the 30-day window. </P><P> </P><P>Thanks for the help!</P><P> </P><DIV class="branch"><DIV align="left"><TABLE border="2" cellspacing="0" cellpadding="3"><TBODY><TR><TD>0012304</TD><TD>02AUG2020</TD></TR><TR><TD>0012304</TD><TD>26JUL2020</TD></TR><TR><TD>0012304</TD><TD>26JUL2020</TD></TR><TR><TD>0012304</TD><TD>23JUL2020</TD></TR><TR><TD>0033056</TD><TD>03AUG2020</TD></TR><TR><TD>0033056</TD><TD>22JUL2020</TD></TR><TR><TD>0051263</TD><TD>03AUG2020</TD></TR><TR><TD>0051263</TD><TD>28JUL2020</TD></TR><TR><TD>0051263</TD><TD>21JUL2020</TD></TR><TR><TD>0075584</TD><TD>10AUG2020</TD></TR><TR><TD>0075584</TD><TD>08AUG2020</TD></TR><TR><TD>0186278</TD><TD>31JUL2020</TD></TR><TR><TD>0186278</TD><TD>17JUL2020</TD></TR><TR><TD>0195000</TD><TD>10AUG2020</TD></TR><TR><TD>0195000</TD><TD>30JUL2020</TD></TR></TBODY></TABLE></DIV></DIV>Sun, 16 Aug 2020 23:53:48 GMThttps://communities.sas.com/t5/SAS-Programming/filter-by-dates-within-by-group/m-p/677122#M204227loishaggard2020-08-16T23:53:48Z