I'm trying to get this if then do statement to work with a lookup macro. Does the macro have to be in multiple places throughout this data step or can I just use it one time? And if so, where does it go? I assume it goes where I have them, but then I don't get all columns after the macro does a lookup of the id and dttm so I'm wondering if the data step is in the order it should be when a macro is being used in an if then do statement.
DATA work.wf_mcd
work.wf_mcd_user
work.wf_mci (KEEP=id_key)
;
SET mcd.asign;
dts_tm = put(cats(userid, "_", put(datepart(dttm), yymmddn8.)), $mdm_rda_dts_team.);
if dts_tm in ("MCD")
THEN DO;
OUTPUT work.wf_mcd;
IF PUT(userid, $mcd_wq_list.) ^= "#"
THEN OUTPUT work.wf_mcd_user;
END;
dts_tm = put(cats(userid, "_", put(datepart(dttm), yymmddn8.)), $mdm_rda_dts_team.);
if dts_tm =: 'MCI'
THEN OUTPUT work.wf_mci;
%dts_lookup(userid, dttm);
RUN;
... View more