yes, this is great. Thank you! Thanks both of you, you were both correct. I don't know why I was making it more complicated than it needed to be. It works very well now: 449 450 DATA scratch.taq2; 451 format date yymmddn8. txtdate $8. symbol $10. time TIME8.; 452 set taq1; 453 454 declare hash wcthash; 455 456 if ('10:00't le acttims < '15:30't) then do; 457 *need date as text to use as title of dataset; 458 txtdate=PUT(actdats, yymmddn8.); 459 460 461 date= actdats; 462 time= INTNX('minutes',acttims,-15); 463 price =.; 464 465 466 mystring = 'wtaq.WCT_'||txtdate||' (where=(symbol='''||symbol||'''))'; 467 468 wcthash = _new_ hash(dataset: mystring, multidata:'yes'); 469 wcthash.DefineKey("date","time"); 470 wcthash.DefineData("date","time","price"); 471 wcthash.DefineDone(); 472 473 474 do while (time < acttims); 475 rc=wcthash.find(); 476 if rc=0 then output; 477 if rc=0 then time = acttims; 478 else time = INTNX('second',time,1); 479 end; 480 481 rc = wcthash.delete(); 482 end; 483 RUN; NOTE: There were 7790 observations read from the data set WTAQ.WCT_20030520. WHERE symbol='IBM '; NOTE: There were 10457 observations read from the data set WTAQ.WCT_20050720. WHERE symbol='IBM '; NOTE: There were 9011 observations read from the data set WTAQ.WCT_20060403. WHERE symbol='IBM '; NOTE: There were 10400 observations read from the data set WTAQ.WCT_20060421. WHERE symbol='IBM '; NOTE: There were 35566 observations read from the data set WTAQ.WCT_20080421. WHERE symbol='IBM '; NOTE: There were 56548 observations read from the data set WTAQ.WCT_20090720. WHERE symbol='IBM '; NOTE: There were 2520 observations read from the data set WTAQ.WCT_20031224. WHERE symbol='IBM '; NOTE: There were 8958 observations read from the data set WTAQ.WCT_20050615. WHERE symbol='IBM '; NOTE: There were 16688 observations read from the data set WTAQ.WCT_20060419. WHERE symbol='IBM '; NOTE: There were 9721 observations read from the data set WTAQ.WCT_20050506. WHERE symbol='IBM '; NOTE: There were 10 observations read from the data set WORK.TAQ1. NOTE: The data set SCRATCH.TAQ2 has 10 observations and 11 variables. NOTE: DATA statement used (Total process time): real time 3.07 seconds cpu time 0.16 seconds
... View more