Clinwright Public work of Clinwright examples · free Start free

14-1.02

Summary of End of Study Data

Made 2026-10-17 from uploaded data.

CDISCPILOT01

Table 14-1.02

Summary of End of Study Data

All Subjects Analysis Set

Placebo (N=86)Xanomeline Low Dose (N=84)Xanomeline High Dose (N=84)Total (N=254)p-value [1]
Completion Status:
Completed Week 2460 (70%)28 (33%)30 (36%)118 (46%)<0.0001
Early Termination (prior to Week 24)26 (30%)56 (67%)54 (64%)136 (54%)
Missing0 (0%)0 (0%)0 (0%)0 (0%)
Reason for Early Termination (prior to Week 24):
Adverse Event8 (9%)44 (52%)39 (46%)91 (36%)<0.0001
Death1 (1%)1 (1%)0 (0%)2 (1%)
Lack of Efficacy[2]3 (3%)0 (0%)1 (1%)4 (2%)0.3281
Lost to Follow-up1 (1%)0 (0%)0 (0%)1 (0%)
Subject decided to withdraw9 (10%)8 (10%)8 (10%)25 (10%)
Physician decided to withdraw subject1 (1%)0 (0%)2 (2%)3 (1%)
Protocol criteria not met0 (0%)0 (0%)0 (0%)0 (0%)
Protocol violation2 (2%)1 (1%)3 (4%)6 (2%)
Sponsor decision1 (1%)2 (2%)1 (1%)4 (2%)
Missing0 (0%)0 (0%)0 (0%)0 (0%)

[1] Fisher's exact test.

[2] Based on either patient/caregiver perception or physician perception.

Program: t-14-1-02.sas

Program t-14-1-02.sas

Version 1, written from Clinwright's patterns, 2026-10-17, checks passed.

/*==== 00-header ====*/
/*----------------------------------------------------------------------------
  Output  : Table 14-1.02 / Summary of End of Study Data / All Subjects Analysis Set
  Program : t-14-1-02.sas   Reporting effort : CSR
  ADaM    : /work/adam (ADSL, ADADAS, ADCIBC, ADLBC, ADLBH, ADNPIX, ADTTE, ADVS, ADAE, ADCM, ADMH, ADEX)
  The header and the report step follow from the shell. The sections between
  them make WORK.FINAL, one record per row of the table, in order:
    _page     the page (1 unless the output is paged); _pagelbl its heading or empty
    _ord      the row's order; _indent the label's indentation (0 = flush left)
    _rowid    the uuid of the shell row it shows (WORK._SHELL); one shell row may
              have several (a category per value); a blank row's is blank-<n>
    _kind     label | stat | blank
    rowlabel  the row's label, as text
    col1      Placebo|(N=xx)
    col2      Xanomeline Low Dose|(N=xx)
    col3      Xanomeline High Dose|(N=xx)
    col4      Total|(N=xx)
    col5      p-value|[1]
  and set the big N of the column headers:
    &_bign1    Placebo|(N=xx)
    &_bign2    Xanomeline Low Dose|(N=xx)
    &_bign3    Xanomeline High Dose|(N=xx)
    &_bign4    Total|(N=xx)
  /work/_lib/clinwright.sas has %ls_bign, %ls_count, %ls_stats, %ls_npct, %ls_num.
----------------------------------------------------------------------------*/
libname adam "/work/adam" access=readonly;
%include "/work/_lib/clinwright.sas";
%ls_setup;

/* The shell's rows, in order, with each column's value pattern (_xx1-_xx5). */
data work._shell;
  length _page 8 _pagelbl $200 _ord 8 _indent 8 _rowid $36 _kind $5 _var $32 rowlabel $200 _xx1 $40 _xx2 $40 _xx3 $40 _xx4 $40 _xx5 $40;
  _page = 1; _pagelbl = '';
  _ord=1; _indent=0; _rowid='88ffc2be-5609-4186-9e04-dcdca3232518'; _kind='label'; _var=''; rowlabel='Completion Status:'; _xx1=''; _xx2=''; _xx3=''; _xx4=''; _xx5=''; output;
  _ord=2; _indent=1; _rowid='77d0551c-1b72-4f62-b531-b57d680192b1'; _kind='stat'; _var=''; rowlabel='Completed Week 24'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='x.xxxx'; output;
  _ord=3; _indent=1; _rowid='16583c12-8a46-4296-a98b-63847d306811'; _kind='stat'; _var=''; rowlabel='Early Termination (prior to Week 24)'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=4; _indent=1; _rowid='75a2eaa3-a90e-43a9-9cc9-4e2df00810d6'; _kind='stat'; _var=''; rowlabel='Missing'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=5; _indent=0; _rowid='blank-5'; _kind='blank'; _var=''; rowlabel=''; _xx1=''; _xx2=''; _xx3=''; _xx4=''; _xx5=''; output;
  _ord=6; _indent=0; _rowid='35c62e44-89f5-4057-9653-a0883cd6f7e2'; _kind='label'; _var=''; rowlabel='Reason for Early Termination (prior to Week 24):'; _xx1=''; _xx2=''; _xx3=''; _xx4=''; _xx5=''; output;
  _ord=7; _indent=1; _rowid='e47a5144-3d65-45f8-8e2a-f8f1de3cc612'; _kind='stat'; _var=''; rowlabel='Adverse Event'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='x.xxxx'; output;
  _ord=8; _indent=1; _rowid='8894716f-26e7-4ab5-a430-a1513cc1949e'; _kind='stat'; _var=''; rowlabel='Death'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=9; _indent=1; _rowid='df60ac77-7e61-4963-8010-4775d0e39c5b'; _kind='stat'; _var=''; rowlabel='Lack of Efficacy[2]'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='x.xxxx'; output;
  _ord=10; _indent=1; _rowid='1b2d582b-16f6-4580-a85f-ca9d1b5ac391'; _kind='stat'; _var=''; rowlabel='Lost to Follow-up'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=11; _indent=1; _rowid='9369f352-89c9-4ded-aa7d-c007eff3e5f9'; _kind='stat'; _var=''; rowlabel='Subject decided to withdraw'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=12; _indent=1; _rowid='7e9cdbdf-029d-492c-8b42-3909c266591b'; _kind='stat'; _var=''; rowlabel='Physician decided to withdraw subject'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=13; _indent=1; _rowid='dbb492fd-8836-4113-a945-c8e346e89528'; _kind='stat'; _var=''; rowlabel='Protocol criteria not met'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=14; _indent=1; _rowid='5f61d8e2-1fe0-4b6a-adb1-aa039c94992b'; _kind='stat'; _var=''; rowlabel='Protocol violation'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=15; _indent=1; _rowid='49a15e41-dbc3-4512-8df3-2301010c4843'; _kind='stat'; _var=''; rowlabel='Sponsor decision'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
  _ord=16; _indent=1; _rowid='3a0fb6c6-c475-44b7-8f3f-59ca97cb93d1'; _kind='stat'; _var=''; rowlabel='Missing'; _xx1='xx (xx%)'; _xx2='xx (xx%)'; _xx3='xx (xx%)'; _xx4='xx (xx%)'; _xx5='xx (xx%)'; output;
run;

/*==== 10-data ====*/
/* Made from the output's analysis: the subjects of ADSL, by TRT01P. */
data work._an;
  set adam.adsl;
  if trt01p in ('Placebo') then do; _col = 1; output; end;
  if trt01p in ('Xanomeline Low Dose') then do; _col = 2; output; end;
  if trt01p in ('Xanomeline High Dose') then do; _col = 3; output; end;
  _col = 4; output;
run;
data work._popc; set work._an(keep=usubjid _col); run;
data work._cols; do _col = 1 to 5; output; end; run;
%ls_bign(data=work._popc, trt=_col, values=1|2|3|4|5|1|2|3|4, names=_lsn1 _lsn2 _lsn3 _lsn4 _lsn5 _bign1 _bign2 _bign3 _bign4);

/* Subjects and records per column. */
proc sort data=work._an(keep=usubjid _col) out=work._u; by _col usubjid; run;
data work._c;
  set work._u;
  by _col usubjid;
  retain _n _e;
  if first._col then do; _n = 0; _e = 0; end;
  _e = _e + 1;
  if first.usubjid then _n = _n + 1;
  if last._col then output;
  keep _col _n _e;
run;
proc transpose data=work._c out=work._tn(drop=_name_) prefix=_n; id _col; var _n; run;
proc transpose data=work._c out=work._te(drop=_name_) prefix=_e; id _col; var _e; run;
data work._z; _z = 1; run;
data work._g0;
  merge work._z work._tn work._te;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  do _i = 1 to 5; _nn{_i} = sum(_nn{_i}, 0); _ee{_i} = sum(_ee{_i}, 0); end;
  _tot = _n4;
  drop _i _z;
run;
/* Completed Week 24: npct of COMP24FL = Y. */
data work._f; set work._g0; do _col = 1 to 5; output; end; run;
proc sort data=work._an(keep=usubjid _col comp24fl where=(comp24fl = 'Y')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._an(keep=usubjid _col comp24fl where=(not missing(comp24fl))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
proc transpose data=work._v out=work._vw(drop=_name_) prefix=_x; id _col; var _vn; run;
data work._pp5;
  set work._vw;
  array _px{5} _x1-_x5;
  %ls_pcounts(p=_p5, x=_px, cols=1 2 3, test=fisher);
  keep _p5;
run;
data work._f; if _n_ = 1 then set work._pp5; set work._f; run;
data work._k1;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '77d0551c-1b72-4f62-b531-b57d680192b1';
  _page = 1;
  _pagelbl = '';
  _k0 = 2;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = ifc(missing(_p5), '', ifc(round(sum(_p5, 0), 0.0001) < 0.0001, '<0.0001', ifc(round(sum(_p5, 0), 0.0001) > 0.9999, '>0.9999', strip(put(round(sum(_p5, 0), 0.0001), 32.4)))));
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
/* Early Termination (prior to Week 24): npct of COMP24FL = N. */
data work._f; set work._g0; do _col = 1 to 5; output; end; run;
proc sort data=work._an(keep=usubjid _col comp24fl where=(comp24fl = 'N')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._an(keep=usubjid _col comp24fl where=(not missing(comp24fl))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k2;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '16583c12-8a46-4296-a98b-63847d306811';
  _page = 1;
  _pagelbl = '';
  _k0 = 3;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
/* Missing: npct where missing(COMP24FL). */
data work._f; set work._g0; do _col = 1 to 5; output; end; run;
proc sort data=work._an(keep=usubjid _col comp24fl where=(missing(COMP24FL))) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._an(keep=usubjid _col comp24fl where=(1)) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k3;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '75a2eaa3-a90e-43a9-9cc9-4e2df00810d6';
  _page = 1;
  _pagelbl = '';
  _k0 = 4;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._as1; set work._an; where (COMP24FL = 'N'); run;
/* Subjects and records per column. */
proc sort data=work._as1(keep=usubjid _col) out=work._u; by _col usubjid; run;
data work._c;
  set work._u;
  by _col usubjid;
  retain _n _e;
  if first._col then do; _n = 0; _e = 0; end;
  _e = _e + 1;
  if first.usubjid then _n = _n + 1;
  if last._col then output;
  keep _col _n _e;
run;
proc transpose data=work._c out=work._tn(drop=_name_) prefix=_n; id _col; var _n; run;
proc transpose data=work._c out=work._te(drop=_name_) prefix=_e; id _col; var _e; run;
data work._z; _z = 1; run;
data work._g1;
  merge work._z work._tn work._te;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  do _i = 1 to 5; _nn{_i} = sum(_nn{_i}, 0); _ee{_i} = sum(_ee{_i}, 0); end;
  _tot = _n4;
  drop _i _z;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Adverse Event: npct of DCSREAS = Adverse Event. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'Adverse Event')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
proc transpose data=work._v out=work._vw(drop=_name_) prefix=_x; id _col; var _vn; run;
data work._pp5;
  set work._vw;
  array _px{5} _x1-_x5;
  %ls_pcounts(p=_p5, x=_px, cols=1 2 3, test=fisher);
  keep _p5;
run;
data work._f; if _n_ = 1 then set work._pp5; set work._f; run;
data work._k4;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = 'e47a5144-3d65-45f8-8e2a-f8f1de3cc612';
  _page = 1;
  _pagelbl = '';
  _k0 = 7;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = ifc(missing(_p5), '', ifc(round(sum(_p5, 0), 0.0001) < 0.0001, '<0.0001', ifc(round(sum(_p5, 0), 0.0001) > 0.9999, '>0.9999', strip(put(round(sum(_p5, 0), 0.0001), 32.4)))));
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Death: npct of DCSREAS = Death. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'Death')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k5;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '8894716f-26e7-4ab5-a430-a1513cc1949e';
  _page = 1;
  _pagelbl = '';
  _k0 = 8;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Lack of Efficacy[2]: npct of DCSREAS = Lack of Efficacy. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'Lack of Efficacy')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
proc transpose data=work._v out=work._vw(drop=_name_) prefix=_x; id _col; var _vn; run;
data work._pp5;
  set work._vw;
  array _px{5} _x1-_x5;
  %ls_pcounts(p=_p5, x=_px, cols=1 2 3, test=fisher);
  keep _p5;
run;
data work._f; if _n_ = 1 then set work._pp5; set work._f; run;
data work._k6;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = 'df60ac77-7e61-4963-8010-4775d0e39c5b';
  _page = 1;
  _pagelbl = '';
  _k0 = 9;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = ifc(missing(_p5), '', ifc(round(sum(_p5, 0), 0.0001) < 0.0001, '<0.0001', ifc(round(sum(_p5, 0), 0.0001) > 0.9999, '>0.9999', strip(put(round(sum(_p5, 0), 0.0001), 32.4)))));
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Lost to Follow-up: npct of DCSREAS = Lost to Follow-up. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'Lost to Follow-up')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k7;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '1b2d582b-16f6-4580-a85f-ca9d1b5ac391';
  _page = 1;
  _pagelbl = '';
  _k0 = 10;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Subject decided to withdraw: npct of DCSREAS = Withdrew Consent. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'Withdrew Consent')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k8;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '9369f352-89c9-4ded-aa7d-c007eff3e5f9';
  _page = 1;
  _pagelbl = '';
  _k0 = 11;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Physician decided to withdraw subject: npct of DCSREAS = Physician Decision. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'Physician Decision')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k9;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '7e9cdbdf-029d-492c-8b42-3909c266591b';
  _page = 1;
  _pagelbl = '';
  _k0 = 12;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Protocol criteria not met: npct of DCSREAS = I/E Not Met. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'I/E Not Met')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k10;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = 'dbb492fd-8836-4113-a945-c8e346e89528';
  _page = 1;
  _pagelbl = '';
  _k0 = 13;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Protocol violation: npct of DCSREAS = Protocol Violation. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'Protocol Violation')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k11;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '5f61d8e2-1fe0-4b6a-adb1-aa039c94992b';
  _page = 1;
  _pagelbl = '';
  _k0 = 14;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Sponsor decision: npct of DCSREAS = Sponsor Decision. */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(dcsreas = 'Sponsor Decision')) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k12;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '49a15e41-dbc3-4512-8df3-2301010c4843';
  _page = 1;
  _pagelbl = '';
  _k0 = 15;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;
data work._ar; set work._an; where (COMP24FL = 'N'); run;
/* Missing: npct of DCSREAS where missing(DCSREAS). */
data work._f; set work._g1; do _col = 1 to 5; output; end; run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(missing(DCSREAS))) out=work._v; by _col usubjid; run;
data work._v;
  set work._v;
  by _col usubjid;
  retain _vn _ve;
  if first._col then do; _vn = 0; _ve = 0; end;
  _ve = _ve + 1;
  if first.usubjid then _vn = _vn + 1;
  if last._col then output;
  keep _col _vn _ve;
run;
proc sort data=work._ar(keep=usubjid _col dcsreas where=(not missing(dcsreas))) out=work._d; by _col usubjid; run;
data work._d;
  set work._d;
  by _col usubjid;
  retain _dn _de;
  if first._col then do; _dn = 0; _de = 0; end;
  _de = _de + 1;
  if first.usubjid then _dn = _dn + 1;
  if last._col then output;
  keep _col _dn _de;
run;
data work._k13;
  length _rowid $36 _label _pagelbl $200 _v $200;
  merge work._f(in=_in) work._v work._d;
  by _col;
  if _in;
  array _nn{5} _n1-_n5;
  array _ee{5} _e1-_e5;
  _rowid = '3a0fb6c6-c475-44b7-8f3f-59ca97cb93d1';
  _page = 1;
  _pagelbl = '';
  _k0 = 16;
  _label = '';
  if _col = 1 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 2 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 3 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 4 then _v = strip(ifc(missing(sum(_vn, 0)), '-', %ls_num(sum(_vn, 0), 0))) || ' (' || strip(ifc(missing(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .)), '-', %ls_num(ifn(input(symget(cats('_lsn', _col)), 8.) > 0, 100 * sum(_vn, 0) / max(input(symget(cats('_lsn', _col)), 8.), 1), .), 0))) || '%)';
  else if _col = 5 then _v = '';
  keep _rowid _label _page _pagelbl _k0 _col _v;
run;

data work._cells; set work._k1 work._k2 work._k3 work._k4 work._k5 work._k6 work._k7 work._k8 work._k9 work._k10 work._k11 work._k12 work._k13; run;
proc sort data=work._cells; by _page _pagelbl _k0 _rowid _label _col; run;
proc transpose data=work._cells out=work._wide(drop=_name_) prefix=col;
  by _page _pagelbl _k0 _rowid _label;
  id _col;
  var _v;
run;
proc sort data=work._wide; by _rowid; run;
proc sort data=work._shell(drop=_page _pagelbl) out=work._rows; by _rowid; run;
data work._inst;
  merge work._wide(in=_w) work._rows(in=_s);
  by _rowid;
  if _w and _s;
  if _label ne '' then rowlabel = _label;
run;
data work._fixed;
  set work._shell;
  if _rowid not in ('77d0551c-1b72-4f62-b531-b57d680192b1' '16583c12-8a46-4296-a98b-63847d306811' '75a2eaa3-a90e-43a9-9cc9-4e2df00810d6' 'e47a5144-3d65-45f8-8e2a-f8f1de3cc612' '8894716f-26e7-4ab5-a430-a1513cc1949e' 'df60ac77-7e61-4963-8010-4775d0e39c5b' '1b2d582b-16f6-4580-a85f-ca9d1b5ac391' '9369f352-89c9-4ded-aa7d-c007eff3e5f9' '7e9cdbdf-029d-492c-8b42-3909c266591b' 'dbb492fd-8836-4113-a945-c8e346e89528' '5f61d8e2-1fe0-4b6a-adb1-aa039c94992b' '49a15e41-dbc3-4512-8df3-2301010c4843' '3a0fb6c6-c475-44b7-8f3f-59ca97cb93d1');
  _k0 = _ord;
run;
data work.final;
  length col1 col2 col3 col4 col5 $200 _pagelbl $200;
  set work._inst work._fixed;
run;
proc sort data=work.final; by _page _k0; run;
data work.final;
  set work.final;
  _ord = _n_;
  keep _page _pagelbl _ord _indent _rowid _kind rowlabel col1 col2 col3 col4 col5;
run;

/*==== 90-report ====*/
/* 90-report: from the shell; the titles, columns, headers and footnotes are not changed here. */
%ls_need(_bign1 _bign2 _bign3 _bign4);
%ls_final_check(columns=_page _pagelbl _ord _indent _rowid _kind rowlabel col1 col2 col3 col4 col5);
proc sort data=work.final out=work._report; by _page _ord; run;
data work._report;
  set work._report;
  /* Two spaces per step of indentation: the label column keeps leading spaces (asis=on). */
  if _indent > 0 then rowlabel = repeat(' ', 2 * _indent - 1) || rowlabel;
run;
%let _lspaged = 0;
proc sql noprint; select count(*) into :_lspaged trimmed from work._report where _pagelbl ne ''; quit;

options orientation=landscape;
ods listing close;
ods rtf file="/work/out/t-14-1-02.rtf" style=journal;
title1 j=l "CDISCPILOT01" j=r "Page ~{thispage} of ~{lastpage}";
title2 j=c "Table 14-1.02";
title3 j=c "Summary of End of Study Data";
title4 j=c "All Subjects Analysis Set";
footnote1 j=l "[1] Fisher's exact test.";
footnote2 j=l "[2] Based on either patient/caregiver perception or physician perception.";
footnote3 j=l "Program: t-14-1-02.sas";
%macro _ls_report;
proc report data=work._report nowd split='|' missing style(report)={width=100%};
  column _page _pagelbl _ord _indent _kind rowlabel col1 col2 col3 col4 col5;
  define _page / order order=internal noprint;
  define _pagelbl / order noprint;
  define _ord / order order=internal noprint;
  define _indent / display noprint;
  define _kind / display noprint;
  define rowlabel / display "" style(column)={cellwidth=40% asis=on} style(header)={just=l};
  define col1 / display "Placebo|(N=&_bign1.)" style(column)={cellwidth=12% just=c} style(header)={just=c};
  define col2 / display "Xanomeline Low Dose|(N=&_bign2.)" style(column)={cellwidth=12% just=c} style(header)={just=c};
  define col3 / display "Xanomeline High Dose|(N=&_bign3.)" style(column)={cellwidth=12% just=c} style(header)={just=c};
  define col4 / display "Total|(N=&_bign4.)" style(column)={cellwidth=12% just=c} style(header)={just=c};
  define col5 / display "p-value|[1]" style(column)={cellwidth=12% just=c} style(header)={just=c};
  %if &_lspaged > 0 %then %do;
  compute before _pagelbl / style={just=l};
    line _pagelbl $200.;
  endcomp;
  %end;
  break after _page / page;
run;
%mend _ls_report;
%_ls_report;
ods rtf close;
ods listing;
%ls_final_export;