Yes, you are right, FriedEgg ! Thank you very much... Do you know if I can find anywhere what different values for the return code mean? In my case I was getting rc=4 but I cannot seem to find anywhere what these individual codes are...
... View more
I am looking for an example on how to use a hash and hash iterator to iterate through a data set inside a DS2 data program. As practical application I would like to build the Cartesian product of two tables. Each of the tables is a list of ID and Value and I want in face to end up with a data set containing all possible pairs of these 2 sets of Value. I tried something like below but is not working. It looks like rc=hi.first(); returns an error code rc=4 but I cannot find anywhere what that means. proc ds2; data one (overwrite=YES); method run(); set post.workPC (RENAME=(Value=Value1 TblID=TblID1)); end; enddata; run; data two (overwrite=YES); method run(); set post.workPC (RENAME=(Value=Value2 TblID=TblID2)); if TblID2 gt 1 then output; end; enddata; run; data prodcart (overwrite=Yes); declare double TblID2 rc; declare char(10) Value2; declare package hash h ('two'); declare package hiter hi('h'); method init(); rc = h.defineKey('TblID2'); rc = h.defineData('Value2'); rc = h.defineDone(); end; method run(); set one; rc=hi.first(); put TblID2 Value2 TblID1 Value1; end; run; quit;
... View more
Is all great to see the top <N> lowest and highest values from a dataset, but can they somehow be stored in a SAS data set? I was looking at the OUTPUT statement but doesn't seem to have anything that will allow me to store those <n> lowest and <n> highest values in some data set and work with them further. Any help greatly appreciated.
... View more