Larry, I have taken a stab at this and failed miserably. I have tried this... and i cannot get it to work... i am using this as a data step and i keep getting a funky error...but of course i cannot find anything similar when i google the error that gives me enough information to understand why the error came up. Here is the code i am using in the datastep which is based off of your code: data WORK.Professional_courteous; if Agent contains '69440225' then do until upcase(Agent) = 'TOTAL'; if upcase(Agent) not in ('TOTAL','Agent')then output; else stop; end; run; When i run this, I get the following error log... and i obviously have done something incorrectly. 1 The SAS System 14:04 Wednesday, August 21, 2013 1 ;*';*";*/;quit;run; 2 OPTIONS PAGENO=MIN; 3 %LET SYSLAST=WORK.SAMPLE_IMPORT; 4 %LET _CLIENTTASKLABEL='Program'; 5 %LET _CLIENTPROJECTPATH=''; 6 %LET _CLIENTPROJECTNAME=''; 7 %LET _SASPROGRAMFILE=; 8 9 ODS _ALL_ CLOSE; 10 OPTIONS DEV=ACTIVEX; 11 GOPTIONS XPIXELS=0 YPIXELS=0; 12 FILENAME EGSR TEMP; 13 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR STYLE=MeadowPrinter 13 ! STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/x86/SASEnterpriseGuide/5.1/Styles/MeadowPrinter.css") NOGTITLE 13 ! NOGFOOTNOTE GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on"); NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR 14 15 GOPTIONS ACCESSIBLE; 16 data WORK.Professional_courteous; 17 if Agent contains '69440225' then do until upcase(Agent) = 'TOTAL'; ________ 388 76 ERROR 388-185: Expecting an arithmetic operator. ERROR 76-322: Syntax error, statement will be ignored. 18 if upcase(Agent) not in ('TOTAL','Agent')then output; 19 else stop; 20 end; ___ 161 ERROR 161-185: No matching DO/SELECT statement. 21 run; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 18:11 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.PROFESSIONAL_COURTEOUS may be incomplete. When this step was stopped there were 0 observations and 1 variables. WARNING: Data set WORK.PROFESSIONAL_COURTEOUS was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.01 seconds 22 23 GOPTIONS NOACCESSIBLE; 24 %LET _CLIENTTASKLABEL=; 25 %LET _CLIENTPROJECTPATH=; 26 %LET _CLIENTPROJECTNAME=; 27 %LET _SASPROGRAMFILE=; 28 29 ;*';*";*/;quit;run; 30 ODS _ALL_ CLOSE; 31 32 2 The SAS System 14:04 Wednesday, August 21, 2013 33 QUIT; RUN; 34 Thanks, DZ
... View more