Hi ,
I am trying to perform a sort on a dataset on a oracle table by referencing the dataset
as Oracle_schema.table1
*--------------------------------------------------------------------------------------*
data _null_; if 0 then set DW.Table1 ; dcl hash hh ( dataset: ' DW.Table1', ordered: 'A', multidata: 'Y') ; dcl hiter hi ( 'hh' ) ; hh.DefineKey ( 'ADMIT_MONTH','PAtientid') ; hh.DefineData ('FUND_MAJOR_DESC' ,'generic_month','ADMIT_MONTH','PAtientid') ; hh.DefineDone () ;
do rc = hi.first () by 0 while ( rc = 0 ) ;
hh.output (dataset: "x1234") ; rc = hi.next () ; end ;
stop ; run ;
****------------------------------------------------------------------**
But it's taking forever to execute . hasn't still completed execution. the table1 has 1.5 million records
I in parallel execute a proc sort for the above method but it took only 3 minutes to execute .
Could some one explain why the above hash code won't execute🤔
proc sort data= DW.Table1 (keep=FUND_MAJOR_DESC generic_month ADMIT_MONTH PAtientid) out=x1234 ; by ADMIT_MONTH PAtientid; run;
*---------------------------------------------------------------------------
to confirm my hash code i executed with sashelp.cars and it works , so i presume the syntax is correct
data _null_; if 0 then set sashelp.cars ; dcl hash hh ( dataset: 'sashelp.cars', ordered: 'a',multidata: "Y") ; dcl hiter hi ( 'hh' ) ; hh.DefineKey ( 'make' ) ; hh.DefineData ( 'invoice' , 'model','make') ; hh.DefineDone () ;
do rc = hi.first () by 0 while ( rc = 0 ) ; hh.output (dataset: "x1") ; rc = hi.next () ; end ; put 13 * '-' ; stop ; run ;
... View more