comp.soft-sys.sas - The SAS statistics package.
Hi All, Few days back i was coding a sas code. There was a part of code that i wrote differently, the CPU time the different coding confused me. Here is the code. /* im taking out dates from a 4 datasets and would be using to extract some rows from a table from DB2 */ Proc sql noprint; select dates into : vlddates from ( select input_date1 from work.sample1 union all select input_date2 from work.sample1 union all select input_date3 from work.sample1 union all select input_date4 from work.sample1 ); quit; proc sort data = db2lib.market_survey out=sushil(keep=cases takem_date); by cases; where taken_date in (&vlddates); run; Due to the IN operater the CPU time got increased substantially. But when I write the same proc sort step number of unique dates that i get in VLDDATES macro and concatanate the datasets. The time is considerably decreased. Can anyone pls let me know what could be the reason. proc sort data = db2lib.market_survey out=sushil(keep=cases takem_date); by cases; where taken_date in '20JAN2009'D; /* one of hte dates in VLDDATES macro*/ run; ..... .repeating the proc sort the same way but for all the rest of the rows present in the VLDDATES .. Note :: taken_date is not indexed and the market_survey table is very huge dataset. Please help me understand why the increase in CPU time when IN operater is used and why = operator decrease it. During my Test run, i realized that when i used = operator and combined the datasets, the whole operation took 13.53 CPU min, while when i used the IN oprator, the whole operation took 752.23 CPU min.. Thanks!
Hi all - Yet another macro resolution issue that I'm stuck on. I've tried quotes around the "ALL", etc. I've tried putting resolve around each (upcase(VAR) ne ALL*) bit, I've tried removing the resolve bits. I've tried saying %if &hetvarmeth not in ("ALL", . . .) I know it's saying lack of required operator (and continued to with those variations); I just don't know what I need to do to have a valid operator. Thoughts? Venita %if resolve(upcase("&hetvarmeth") ne ALL and upcase("&hetvarmeth") ne ALLBIVAR and upcase("&hetvarmeth") ne ALLMULTIVAR) %then %do; . . . . . %end; The log: SYMBOLGEN: Macro variable HETVARMETH resolves to ALLMULTIVAR ERROR: Required operator not found in expression: resolve(upcase("&hetvarmeth") ne ALL and upcase("&hetvarmeth") ne ALLBIVAR and upcase("&hetvarmeth") ne ALLMULTIVAR)
For example: value of name: John value of Birthday: 090225 (format as yymmdd6.) New value for the new variable: John090225; for the new variable, the birthday keeps yymmdd format(two digits year, two digits month, two digits day). Thank you!