Review ask

As a clinical trial statistician or programmer, answer three short questions in Your review: the task, the inputs and outputs, and the AI-assisted review. Agreeing with all three approves this benchmark; disagreeing with any needs a comment. Propose a fix with the Edit button on any source file, or add it to your comments.

We suggest spending no more than 5 minutes on a review. The other tabs beside Your review are background for assessment, not under review.

Summary

Lifecycle: reviewedEditUnder review
What this benchmark means
README.md

Public entries: Python and R. Passing coverage requires an installed inventory.

Goal: build a laboratory (LB) basic data structure (BDS) analysis dataset for alanine aminotransferase (ALT) and aspartate aminotransferase (AST): flag each subject's baseline record (ABLFL), carry its value (BASE), compute change (CHG) and percent change (PCHG), and add one ALT record converted to International System of Units (SI) (ALTSI), alongside each subject's treatment start date (TRTSDT) and actual treatment (TRT01A).

Input: collected ALT and AST results with collection dates, numeric results, and units, plus subject-level treatment start dates and actual treatments.

Variables:

  • ADT is the collection date of the result.
  • TRTSDT is the subject's treatment start date.
  • TRT01A is the subject's actual treatment.
  • AVAL is the collected numeric result, or the result times 0.0167 on the SI record.
  • AVALU is the collected unit, or ukat/L on the SI record.
  • ABLFL is Y on the latest record on or before the treatment start date for each subject and parameter; blank otherwise.
  • BASE is the AVAL of the flagged baseline record, repeated on every record for the same subject and parameter.
  • CHG is AVAL minus BASE.
  • PCHG is 100 times CHG divided by BASE; empty when the baseline value is zero, since the percentage is undefined.

Note: a collected result with no numeric value produces no record. A subject with no collected results has no records: the treatment dates enrich records that already exist and never add one. A subject with a single collected result still gets a baseline flag, and a result collected on the treatment start date itself counts as baseline.

Inputs

Under review
2 source files

input/adsl.csv

Edit
6 rows
input/adsl.csv
STUDYIDUSUBJIDTRTSDTTRT01A
YAMAA-012025-01-02Study Drug 50 mg
YAMAA-012025-01-02Study Drug 100 mg
YAMAA-012025-01-02Placebo
YAMAA-012025-01-02Placebo
YAMAA-012025-01-02Placebo
YAMAA-012025-01-02Study Drug 50 mg

input/lb.csv

Edit
12 rows
input/lb.csv
STUDYIDUSUBJIDLBTESTCDLBTESTLBDTCLBSTRESNLBSTRESU
YAMAA-01ALTAlanine Aminotransferase2025-01-0110U/L
YAMAA-01ALTAlanine Aminotransferase2025-01-0815U/L
YAMAA-01ASTAspartate Aminotransferase2025-01-0120U/L
YAMAA-01ASTAspartate Aminotransferase2025-01-0818U/L
YAMAA-01ALTAlanine Aminotransferase2025-01-018U/L
YAMAA-01ALTAlanine Aminotransferase2025-01-0812U/L
YAMAA-01ALTAlanine Aminotransferase2025-01-010U/L
YAMAA-01ALTAlanine Aminotransferase2025-01-085U/L
YAMAA-01ALTAlanine Aminotransferase2025-01-15—U/L
YAMAA-01ALTAlanine Aminotransferase2024-12-2022U/L
YAMAA-01ALTAlanine Aminotransferase2025-01-0230U/L
YAMAA-01ALTAlanine Aminotransferase2025-01-0936U/L

Expected output

Under review
20 expected rows

expected/adlb.csv

Edit
20 rows
expected/adlb.csv
STUDYIDUSUBJIDPARAMCDPARAMADTTRTSDTTRT01AAVALAVALUABLFLBASECHGPCHGASEQ
YAMAA-01ALTAlanine Aminotransferase2025-01-012025-01-02Study Drug 50 mg10U/LY10001
YAMAA-01ALTAlanine Aminotransferase2025-01-082025-01-02Study Drug 50 mg15U/L—105502
YAMAA-01ALTAlanine Aminotransferase2025-01-012025-01-02Study Drug 100 mg8U/LY8001
YAMAA-01ALTAlanine Aminotransferase2025-01-082025-01-02Study Drug 100 mg12U/L—84502
YAMAA-01ALTAlanine Aminotransferase2025-01-012025-01-02Placebo0U/LY00—1
YAMAA-01ALTAlanine Aminotransferase2025-01-082025-01-02Placebo5U/L—05—2
YAMAA-01ALTAlanine Aminotransferase2024-12-202025-01-02Placebo22U/LY22001
YAMAA-01ALTAlanine Aminotransferase2025-01-022025-01-02Study Drug 50 mg30U/LY30001
YAMAA-01ALTAlanine Aminotransferase2025-01-092025-01-02Study Drug 50 mg36U/L—306202
YAMAA-01ALTSIAlanine Aminotransferase (SI)2025-01-012025-01-02Study Drug 50 mg0.16699999999999998ukat/LY0.16699999999999998003
YAMAA-01ALTSIAlanine Aminotransferase (SI)2025-01-082025-01-02Study Drug 50 mg0.2505ukat/L—0.166999999999999980.0835000000000000250.0000000000000144
YAMAA-01ALTSIAlanine Aminotransferase (SI)2025-01-012025-01-02Study Drug 100 mg0.1336ukat/LY0.1336003
YAMAA-01ALTSIAlanine Aminotransferase (SI)2025-01-082025-01-02Study Drug 100 mg0.2004ukat/L—0.13360.0668504
YAMAA-01ALTSIAlanine Aminotransferase (SI)2025-01-012025-01-02Placebo0ukat/LY00—3
YAMAA-01ALTSIAlanine Aminotransferase (SI)2025-01-082025-01-02Placebo0.08349999999999999ukat/L—00.08349999999999999—4
YAMAA-01ALTSIAlanine Aminotransferase (SI)2024-12-202025-01-02Placebo0.3674ukat/LY0.3674002
YAMAA-01ALTSIAlanine Aminotransferase (SI)2025-01-022025-01-02Study Drug 50 mg0.501ukat/LY0.501003
YAMAA-01ALTSIAlanine Aminotransferase (SI)2025-01-092025-01-02Study Drug 50 mg0.6012ukat/L—0.5010.1001999999999999619.9999999999999934
YAMAA-01ASTAspartate Aminotransferase2025-01-012025-01-02Study Drug 50 mg20U/LY20005
YAMAA-01ASTAspartate Aminotransferase2025-01-082025-01-02Study Drug 50 mg18U/L—20-2-106
Shaded columns are derived— = missing value

Human review and assessment

Your review

3 questions and your comments · View benchmark discussions

Mapping spec

Generated from the benchmark YAML; do not edit by hand

Dataset NameVariable NameVariable LabelTypeCodelist/Controlled TermsCoreComputational MethodOrigin
ADLBSTUDYIDStudy IdentifiercharacterCopy value from LB.STUDYID.Predecessor
ADLBUSUBJIDUnique Subject IdentifiercharacterCopy value from LB.USUBJID.Predecessor
ADLBPARAMCDParameter CodecharacterSet per constructed row; see the Row construction sheet.Derived
ADLBPARAMParametercharacterSet per constructed row; see the Row construction sheet.Derived
ADLBADTAnalysis DatenumericISO 8601Copy value from LB.LBDTC.Predecessor
ADLBTRTSDTDate of First Exposure to TreatmentnumericISO 8601Copy value from ADSL.TRTSDT.Predecessor
ADLBTRT01AActual Treatment for Period 01characterCopy value from ADSL.TRT01A.Predecessor
ADLBAVALAnalysis ValuenumericSet per constructed row; see the Row construction sheet.Derived
ADLBAVALUAnalysis Value UnitcharacterSet per constructed row; see the Row construction sheet.Derived
ADLBABLFLBaseline Record Flagcharacter"Y" for the last record with ADT on or before TRTSDT and a non-missing AVAL within each group of STUDYID, USUBJID, PARAMCD, ordered by ADT; blank otherwise.Derived
ADLBBASEBaseline ValuenumericAggregate ONLY(AVAL) over records grouped by STUDYID, USUBJID, PARAMCD, matching on the shared output keys, where ABLFL = 'Y'.Derived
ADLBCHGChange from BaselinenumericCompute AVAL - BASE.Derived
ADLBPCHGPercent Change from BaselinenumericCompute 100 * CHG / NULLIF(BASE, 0).Derived
ADLBASEQAnalysis Sequence NumbernumericRow number within each group of STUDYID, USUBJID, ordered by PARAMCD then ADT.Derived
TemplateInclude whenPARAMCDPARAMAVALAVALU
altLB.LBTESTCD = 'ALT' AND LB.LBSTRESN IS NOT NULLConstant "ALT"Constant "Alanine Aminotransferase"Copy LB.LBSTRESNCopy LB.LBSTRESU
alt_siLB.LBTESTCD = 'ALT' AND LB.LBSTRESN IS NOT NULLConstant "ALTSI"Constant "Alanine Aminotransferase (SI)"Compute LB.LBSTRESN * 0.0167Constant "ukat/L"
astLB.LBTESTCD = 'AST' AND LB.LBSTRESN IS NOT NULLConstant "AST"Constant "Aspartate Aminotransferase"Copy LB.LBSTRESNCopy LB.LBSTRESU
VersionDateAuthorDescriptionReviewerSign-off
1.72026-10-20yamaa docs buildRead a specification in the 1.0 surface as its 0.5 counterpart; state that missing values stay missing where a mapping declares no missing handler, and leave out a declared missing answer that restates a handler's default
1.62026-10-17yamaa docs buildDescribe collected date parts written as ISO 8601 date text and times of day counted in seconds since midnight
1.52026-10-17yamaa docs buildName collected precision in words instead of letter codes; state imputation fallbacks, minimum source precision, bounds ignored outside the collected period, and invalid text with no handler as an error; describe date and datetime shifts, imputation flag codes, and partial text giving no date part
1.42026-10-15yamaa docs buildState datetime precision codes through the hour and minute, and complete only the time parts a collected datetime lacks
1.32026-09-29yamaa docs buildShow study codelist names, external dictionaries, and ISO 8601 formats in variable rows; list the document's codelist values and metadata
1.22026-09-29yamaa docs buildClassify ADaM copies from a declared input as Predecessor and recodes as Derived, and SDTM recodes of locally derived columns as Derived
1.12026-09-29yamaa docs buildResolve lookups into the donor record they select, and give every derivation shape a plain-language rule instead of its raw YAML
1.0yamaa docs buildInitial generation from spec.yaml

Agent prompt

The request an agent receives with the input files; each tier states no more than the one above

prompts/adam-adlb-bds/full.md

Edit
32 lines

Following CDISC ADaM standards, use the provided ADSL and LB datasets to create an ADLB dataset with one record per subject per parameter per collection date.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, ADT, TRTSDT, TRT01A, AVAL, AVALU, ABLFL, BASE, CHG, PCHG, ASEQ

The output holds one record for each collected ALT or AST result that has a numeric value, and one further record for each such ALT result converted to SI units. A collected result with no numeric value produces no record. PARAMCD is "ALT" and PARAM is "Alanine Aminotransferase" for a collected ALT result, "ALTSI" and "Alanine Aminotransferase (SI)" for a converted record, and "AST" and "Aspartate Aminotransferase" for a collected AST result. ADT is the collection date of the result. TRTSDT is the subject's treatment start date, and TRT01A is the subject's actual treatment. A subject with no collected results has no records: TRTSDT and TRT01A enrich records that already exist and never add one. AVAL is the collected numeric result, or the result times 0.0167 on the SI record. AVALU is the collected unit, or "ukat/L" on the SI record. ABLFL is "Y" on the latest record on or before the treatment start date for each subject and parameter, and has no value otherwise. A result collected on the treatment start date itself counts as baseline, and a subject with a single collected result for a parameter still gets a baseline flag. BASE is the AVAL of the flagged baseline record, repeated on every record for the same subject and parameter. CHG is AVAL minus BASE. PCHG is 100 times CHG divided by BASE, and has no value when BASE is zero. AVAL, CHG, and PCHG are not rounded. ASEQ numbers the records within each subject in order of PARAMCD and then ADT, starting at 1.

Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.

prompts/adam-adlb-bds/conventions.md

Edit
15 lines

Following CDISC ADaM standards, use the provided ADSL and LB datasets to create an ADLB dataset with one record per subject per parameter per collection date.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, ADT, TRTSDT, TRT01A, AVAL, AVALU, ABLFL, BASE, CHG, PCHG, ASEQ

PARAMCD is "ALT" and PARAM is "Alanine Aminotransferase", PARAMCD is "ALTSI" and PARAM is "Alanine Aminotransferase (SI)", or PARAMCD is "AST" and PARAM is "Aspartate Aminotransferase". ABLFL is "Y" or has no value. AVAL, CHG, and PCHG are not rounded.

Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.

prompts/adam-adlb-bds/brief.md

Edit
10 lines

Following CDISC ADaM standards, use the provided ADSL and LB datasets to create an ADLB dataset with one record per subject per parameter per collection date.

The output dataset should contain the following columns in this order: STUDYID, USUBJID, PARAMCD, PARAM, ADT, TRTSDT, TRT01A, AVAL, AVALU, ABLFL, BASE, CHG, PCHG, ASEQ

Read the source datasets from /app/input and save the completed dataset as /app/output/adlb.csv.

yamaa code

Public calls generated from benchmark.yaml; results must match the expected output

R

Edit
3 lines
library(yamaa)yamaa_spec("spec.yaml")$run()$output

Python

Edit
3 lines
import yamaayamaa.spec("spec.yaml").run().output

Solution without yamaa

Written from the full prompt and the inputs alone; CI checks it reproduces the expected output

solutions/adam-adlb-bds/result.R

Edit
113 lines
# Reference solution for the yamaa benchmark adam-adlb-bds (R track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1.library(dplyr, warn.conflicts = FALSE)library(readr)adsl <- read_csv(  "/app/input/adsl.csv",  col_types = cols(TRTSDT = col_date(), .default = col_character()))lb <- read_csv(  "/app/input/lb.csv",  col_types = cols(    LBDTC = col_date(),    LBSTRESN = col_double(),    .default = col_character()  ))# One record per collected ALT/AST result; a collected result with no# numeric value produces no record.collected <- lb |>  filter(LBTESTCD %in% c("ALT", "AST"), !is.na(LBSTRESN))# ALT and AST hold the collected result and unit; ALTSI holds the ALT# result times 0.0167 with unit ukat/L, one record for each ALT record.alt <- collected |>  filter(LBTESTCD %in% "ALT") |>  transmute(    STUDYID, USUBJID,    PARAMCD = "ALT",    PARAM = "Alanine Aminotransferase",    ADT = LBDTC,    AVAL = LBSTRESN,    AVALU = LBSTRESU  )ast <- collected |>  filter(LBTESTCD %in% "AST") |>  transmute(    STUDYID, USUBJID,    PARAMCD = "AST",    PARAM = "Aspartate Aminotransferase",    ADT = LBDTC,    AVAL = LBSTRESN,    AVALU = LBSTRESU  )altsi <- collected |>  filter(LBTESTCD %in% "ALT") |>  transmute(    STUDYID, USUBJID,    PARAMCD = "ALTSI",    PARAM = "Alanine Aminotransferase (SI)",    ADT = LBDTC,    AVAL = LBSTRESN * 0.0167,    AVALU = "ukat/L"  )base <- bind_rows(alt, ast, altsi) |>  left_join(    adsl |> select(STUDYID, USUBJID, TRTSDT, TRT01A),    by = c("STUDYID", "USUBJID")  )# ABLFL is Y on the latest record on or before the treatment start date# for each subject and parameter, including the start date itself.baseline_dates <- base |>  filter(ADT <= TRTSDT) |>  group_by(STUDYID, USUBJID, PARAMCD) |>  summarise(BASE_DT = max(ADT), .groups = "drop")with_flag <- base |>  left_join(baseline_dates, by = c("STUDYID", "USUBJID", "PARAMCD")) |>  mutate(ABLFL = if_else(!is.na(BASE_DT) & ADT == BASE_DT, "Y", NA_character_))# BASE repeats the flagged baseline value; CHG and PCHG follow, with PCHG# empty when the baseline is zero. Values are not rounded.baselines <- with_flag |>  filter(ABLFL %in% "Y") |>  select(STUDYID, USUBJID, PARAMCD, BASE = AVAL)adlb_flagged <- with_flag |>  select(-BASE_DT) |>  left_join(baselines, by = c("STUDYID", "USUBJID", "PARAMCD")) |>  mutate(    CHG = AVAL - BASE,    PCHG = if_else(      is.na(BASE) | BASE == 0,      NA_real_,      100 * (AVAL - BASE) / BASE    )  )# ASEQ numbers each subject's records from 1, ordered by PARAMCD (ALT,# then ALTSI, then AST) and then by ADT.param_order <- c("ALT" = 0L, "ALTSI" = 1L, "AST" = 2L)adlb <- adlb_flagged |>  mutate(PARAM_ORDER = param_order[PARAMCD]) |>  arrange(STUDYID, USUBJID, PARAM_ORDER, ADT) |>  group_by(STUDYID, USUBJID) |>  mutate(ASEQ = row_number()) |>  ungroup() |>  arrange(PARAM_ORDER, USUBJID, ADT) |>  select(    STUDYID, USUBJID, PARAMCD, PARAM, ADT, TRTSDT, TRT01A,    AVAL, AVALU, ABLFL, BASE, CHG, PCHG, ASEQ  )dir.create("/app/output", showWarnings = FALSE)write_csv(adlb, "/app/output/adlb.csv", na = "")

solutions/adam-adlb-bds/result.py

Edit
137 lines
# Reference solution for the yamaa benchmark adam-adlb-bds (Python track).## Written from the benchmark's full prompt and its inputs alone, as an agent# would write it. Harbor's oracle agent runs it to check that the prompt can# be solved and that the grader scores a correct answer 1.import csvfrom collections import OrderedDictINPUT_DIR = "/app/input"OUTPUT_DIR = "/app/output"def fmt(value):    if value is None:        return ""    if isinstance(value, str):        return value    if value == int(value) and abs(value) < 1e15:        return str(int(value))    return repr(value)def main():    adsl = {}    with open(f"{INPUT_DIR}/adsl.csv", newline="") as f:        for row in csv.DictReader(f):            adsl[row["USUBJID"]] = row    params = {        "ALT": ("ALT", "Alanine Aminotransferase"),        "AST": ("AST", "Aspartate Aminotransferase"),    }    records = []    with open(f"{INPUT_DIR}/lb.csv", newline="") as f:        for row in csv.DictReader(f):            testcd = row["LBTESTCD"]            if testcd not in params:                continue            raw = (row["LBSTRESN"] or "").strip()            if raw == "":                continue            try:                aval = float(raw)            except ValueError:                continue            subj = adsl.get(row["USUBJID"], {})            base_rec = {                "STUDYID": row["STUDYID"],                "USUBJID": row["USUBJID"],                "ADT": row["LBDTC"],                "TRTSDT": subj.get("TRTSDT", ""),                "TRT01A": subj.get("TRT01A", ""),            }            paramcd, param = params[testcd]            rec = dict(base_rec)            rec.update({                "PARAMCD": paramcd,                "PARAM": param,                "AVAL": aval,                "AVAL_TEXT": raw,                "AVALU": row["LBSTRESU"],            })            records.append(rec)            if testcd == "ALT":                si = dict(base_rec)                si.update({                    "PARAMCD": "ALTSI",                    "PARAM": "Alanine Aminotransferase (SI)",                    "AVAL": aval * 0.0167,                    "AVAL_TEXT": None,                    "AVALU": "ukat/L",                })                records.append(si)    # Baseline: latest record on or before TRTSDT per subject + parameter.    groups = OrderedDict()    for rec in records:        groups.setdefault((rec["USUBJID"], rec["PARAMCD"]), []).append(rec)    for key, grecs in groups.items():        baseline = None        for rec in grecs:            if rec["TRTSDT"] and rec["ADT"] <= rec["TRTSDT"]:                if baseline is None or rec["ADT"] > baseline["ADT"]:                    baseline = rec        for rec in grecs:            rec["ABLFL"] = "Y" if rec is baseline else ""            if baseline is None:                rec["BASE"] = None                rec["CHG"] = None                rec["PCHG"] = None            else:                base = baseline["AVAL"]                chg = rec["AVAL"] - base                rec["BASE"] = base                rec["CHG"] = chg                rec["PCHG"] = None if base == 0 else 100.0 * chg / base    records.sort(key=lambda r: (r["USUBJID"], r["PARAMCD"], r["ADT"]))    by_subject = OrderedDict()    for rec in records:        by_subject.setdefault(rec["USUBJID"], []).append(rec)    for subj, srecs in by_subject.items():        for i, rec in enumerate(srecs, start=1):            rec["ASEQ"] = i    columns = ["STUDYID", "USUBJID", "PARAMCD", "PARAM", "ADT", "TRTSDT",               "TRT01A", "AVAL", "AVALU", "ABLFL", "BASE", "CHG", "PCHG",               "ASEQ"]    with open(f"{OUTPUT_DIR}/adlb.csv", "w", newline="") as f:        writer = csv.writer(f)        writer.writerow(columns)        for rec in records:            writer.writerow([                rec["STUDYID"],                rec["USUBJID"],                rec["PARAMCD"],                rec["PARAM"],                rec["ADT"],                rec["TRTSDT"],                rec["TRT01A"],                rec["AVAL_TEXT"] if rec["AVAL_TEXT"] is not None                else fmt(rec["AVAL"]),                rec["AVALU"],                rec["ABLFL"],                fmt(rec["BASE"]),                fmt(rec["CHG"]),                fmt(rec["PCHG"]),                rec["ASEQ"],            ])if __name__ == "__main__":    main()

solutions/adam-adlb-bds/result.sas

Edit
43 lines
/* opensas reference solution for the yamaa benchmark adam-adlb-bds.   Reads the benchmark inputs and derives the requested output.   Execute with the existing opensas runtime: opensas /app/output/result.sas. */data adsl;  length STUDYID USUBJID TRTSDT TRT01A $1024;  infile "/app/input/adsl.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. TRTSDT : $char1024. TRT01A : $char1024.;run;data lb;  length STUDYID USUBJID LBTESTCD LBTEST LBDTC LBSTRESU $1024;  infile "/app/input/lb.csv" dsd dlm="," firstobs=2 truncover lrecl=32767;  input STUDYID : $char1024. USUBJID : $char1024. LBTESTCD : $char1024. LBTEST : $char1024. LBDTC : $char1024. LBSTRESN LBSTRESU : $char1024.;run;data parameters;  length PARAMCD $16 PARAM $40 ADT $10 AVALU $1024;  set lb;  if LBTESTCD in ('ALT','AST') and not missing(LBSTRESN);  ADT=LBDTC; PARAMCD=LBTESTCD; AVAL=LBSTRESN; AVALU=LBSTRESU;  if LBTESTCD='ALT' then PARAM='Alanine Aminotransferase'; else PARAM='Aspartate Aminotransferase';  output;  if LBTESTCD='ALT' then do; PARAMCD='ALTSI'; PARAM='Alanine Aminotransferase (SI)'; AVAL=LBSTRESN*0.0167; AVALU='ukat/L'; output; end;run;proc sql; create table joined as select a.*,b.TRTSDT,b.TRT01A from parameters as a left join adsl as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID; quit;proc sort data=joined(where=(ADT ne '' and TRTSDT ne '' and ADT<=TRTSDT)) out=candidates; by STUDYID USUBJID PARAMCD descending ADT; run;data baseline; set candidates; by STUDYID USUBJID PARAMCD; if first.PARAMCD; BASE=AVAL; keep STUDYID USUBJID PARAMCD ADT BASE; rename ADT=BASEDT; run;proc sql; create table combined as select a.*,b.BASE,b.BASEDT from joined as a left join baseline as b on a.STUDYID=b.STUDYID and a.USUBJID=b.USUBJID and a.PARAMCD=b.PARAMCD; quit;proc sort data=combined; by STUDYID USUBJID PARAMCD ADT; run;data result;  length ABLFL $1;  set combined; by STUDYID USUBJID;  if first.USUBJID then ASEQ=0; ASEQ+1;  if ADT=BASEDT and not missing(BASEDT) then ABLFL='Y';  CHG=AVAL-BASE;  if not missing(BASE) and BASE ne 0 then PCHG=100*CHG/BASE;run;proc sql;  create table final as select STUDYID, USUBJID, PARAMCD, PARAM, ADT, TRTSDT, TRT01A, AVAL, AVALU, ABLFL, BASE, CHG, PCHG, ASEQ from result;quit;proc export data=final outfile="/app/output/adlb.csv" dbms=csv replace; run;