Ok, this works: proc ds2;
data foo (overwrite=yes);
dcl char(9) stock;
dcl double open close;
dcl package hash h(8, '{SELECT stock,"open","close" FROM lookup}'); * so why does this fail??? ;
dcl package hiter hi('h');
method init();
dcl double rc;
rc = h.defineKey('stock');
rc = h.defineData('open');
rc = h.defineData('close');
rc = h.defineDone();
end;
method run();
dcl double rc;
set fact;
rc = hi.first();
do while(rc=0);
output;
rc = hi.next();
end;
end;
enddata;
run;
quit; "open" and "close" are not listed as reserved words in Ch 21 "DS2 Reserved Words" of the DS2 Language Reference. However, they are listed as reserved words in the FedSQL documentation: http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/viewer.htm#p0x0k1rlx0l7e4n1ptngog3ce4jp.htm. A link to that documentation from Ch 21 would be useful. SAS R&D - would it be that hard to say something like "open is a reserved word" in the error message??? Clear and consise error messages make your customers' and Tech Support's life a lot easier!
... View more