Wednesday, January 23, 2013

SAS: Merge has one END only!

SAS' Merge has one END only.  The indicated variable is set to 1 when both files are at end of file...

    data Work.Updated (keep = Store Date Cost) ;
    merge Work.Master (rename = (Cost = m_Cost) in=in_master)
        Work.Trans (rename = (Cost = t_Cost) in=in_trans )
        end=eof_both ;
    by Store Date;

...and later...

    if (eof_both) then do;
        * do eof stuff ;
    end;  
    run;


No comments:

Post a Comment