/**
  @file getchangeinfo.sas
  @brief Returns the details for an approval diff
  @details

  <h4> SAS Macros </h4>
  @li mf_getengine.sas
  @li dc_assignlib.sas
  @li mp_abort.sas

  @version 9.2
  @author 4GL Apps Ltd
  @copyright 4GL Apps Ltd.  This code may only be used within Data Controller
    and may not be re-distributed or re-sold without the express permission of
    4GL Apps Ltd.

**/

%mpeinit()

%let table=;
data _null_;
  set SASControlTable;
  call symputx('table',table);
run;

%dc_assignlib(WRITE,%scan(&table,1,.))

%let max_ver_dttm=0;

data APPROVE1;
  set &mpelib..mpe_submit
    (rename=(SUBMITTED_ON_DTTM=submitted_on REVIEWED_ON_DTTM=REVIEWED_ON));
  where TABLE_ID="&TABLE";
  TABLE_NM=cats(base_lib,'.',base_ds);
  BASE_TABLE=table_nm;
  call symputx('base_lib',base_lib);
  REVIEWED_ON_DTTM=put(reviewed_on,datetime19.);
  SUBMITTED_ON_DTTM=put(submitted_on,datetime19.);
run;

data jsParams;
  set approve1;
  LIB_ENGINE="%mf_getEngine(&base_lib)";
run;

%mp_abort(iftrue= (&syscc ne 0)
  ,mac=&_program..sas
  ,msg=%str(syscc=&syscc)
)

%webout(OPEN)
%webout(OBJ,jsParams)
%webout(CLOSE)


%mpeterm()
