Independent and not affiliated with the FDA, MHRA, ISPE, PDA, or any agency. Get the appgoutham@madhadi.com
madhadi.comData Integrity & GxP Quality
Browse all topics → Articles Templates & Procedures Learning paths GlossaryScenariosToolsRegulatory ReferencesLearning PathsTopics About Start here
Log Plug-and-play starting point Clinical & GCP

Log: Statistical Programming Validation Discrepancy Log

A plug-and-play discrepancy log for independent statistical programming: field definitions, entry rules, how to record root cause and resolution so a reviewer can see which program was right, retention, and a filled sample.

Document type: Log

Read and copy the template below into your own quality system. It is a generic starting point for your own internal use, provided as is, with no warranty; see the Terms and License. Adopting it does not by itself create compliance.

This is a ready-to-use discrepancy log for independent (double) programming validation. It records every difference the compare reports, its root cause, which program was correct, and the resolution, so a reviewer can see that the right program won each disagreement. Replace every <<FILL: ...>> placeholder, keep it under version control with the validation package, and retain it as a GCP record. A filled sample row follows. This is general educational content to adapt, not regulatory advice.

Purpose and when to use

Open one discrepancy log per output (or per related output group) under validation. Record a row for every discrepancy the automated compare flags, and for every mismatch against the approved shell. A discrepancy stays open until its root cause is documented and the compare reruns clean. A closed log with a clean final compare is the evidence that the delivered output equals the validated one.

Header (one per log)

FieldEntry
Study / protocol<<FILL: study ID>>
Output(s) covered<<FILL: table/listing/figure ID(s)>>
Validation tier<<FILL: 1 / 2 / 3>>
Production programmer<<FILL: name>>
Validation programmer<<FILL: name>>
SAP version<<FILL: version>>
Shell version<<FILL: version>>

Field definitions

FieldFormatRequiredWho entersWhen
Discrepancy IDSequential (e.g. D-001)YesValidation programmerAt detection
Date raisedDateYesValidation programmerAt detection
Output / variableTable/variable nameYesValidation programmerAt detection
DescriptionFree text: what differedYesValidation programmerAt detection
Compare evidenceReference to compare log lineYesValidation programmerAt detection
Suspected sourceProduction / validation / spec / dataYesEither programmerDuring investigation
Root causeFree textYesOwner of the defective programAt resolution
Which program was correctProduction / Validation / Both wrong / SAP ambiguousYesBoth, agreedAt resolution
Resolution / actionFree text: what was changedYesOwner of the defective programAt resolution
SAP amendment neededYes / No / N/AYesStatisticianAt resolution (if spec issue)
Rerun compare cleanYes / NoYesValidation programmerAfter fix
StatusOpen / ClosedYesValidation programmerOngoing
Date closedDateYes at closeValidation programmerAt close

Entry rules

  • Record every flagged difference, including ones that turn out to be the validation program’s own defect. A log that only shows production defects looks curated.
  • “Matches except rounding” is a discrepancy, not a pass. Record it, find which program implemented the SAP rounding rule wrong, and fix it.
  • Name the SAP section when the root cause is an ambiguous or misread specification, and route it to the statistician; if the analysis itself changes, that goes through a dated SAP amendment, not a quiet code edit.
  • A discrepancy is closed only when the compare reruns clean and the root cause and resolution are recorded. Do not close on “could not reproduce.”
  • The reviewer who signs the validation record confirms the log has no open rows before sign-off.

The discrepancy table

IDDate raisedOutput / variableDescriptionSuspected sourceRoot causeCorrect programResolutionSAP amend?Rerun cleanStatusDate closed
<<FILL>><<FILL>><<FILL>><<FILL>><<FILL>><<FILL>><<FILL>><<FILL>><<FILL>><<FILL>><<FILL>><<FILL>>

Retention

Retain the discrepancy log with the validation package (programs, compare logs, program logs, signed validation record) under the trial master file retention schedule, for not less than <<FILL: retention period>>. The log is a GCP record and is subject to the same integrity expectations (attributable, contemporaneous, complete) as any study record.


Filled sample

The following shows two completed rows for a primary efficacy table, so you can see the expected detail. Names and numbers are illustrative.

Header: Study ABC-301; Output Table 14.2.1 (responder rate, Week 24, ITT); Tier 1; Production J. Okafor; Validation L. Serra; SAP v3.0; Shell v2.

IDDate raisedOutput / variableDescriptionSuspected sourceRoot causeCorrect programResolutionSAP amend?Rerun cleanStatusDate closed
D-00110 Jul 2026Table 14.2.1, placebo denominatorPlacebo N = 88 (prod) vs 90 (val)ProductionProd dropped 2 subjects with a Week 24 visit outside the window; SAP keeps all randomized ITT in the denominatorValidationCorrected prod denominator logic to keep out-of-window subjectsNoYesClosed11 Jul 2026
D-00210 Jul 2026Responder %, treatment arm41.15% (prod) vs 41.2% (val)SpecSAP rounding rule read two ways; SAP specifies round-half-up to one decimalValidationCorrected prod rounding to match SAPNoYesClosed11 Jul 2026

In this example the second program caught a denominator error that would have inflated the placebo response rate and shrunk the treatment difference in the primary endpoint, and a rounding difference that revealed the SAP rule had been implemented two ways. Both were traced to a documented root cause, corrected in the program that was wrong, and closed only after the compare reran clean. That is the evidence that makes the primary endpoint defensible.

Common inspection findings this log prevents

  • Discrepancies closed with no documented root cause, so there is no evidence the correct program won.
  • A log that shows only production defects, implying the validation program was never itself wrong.
  • Rounding differences dismissed as trivial rather than traced to a SAP rule implemented inconsistently.
  • An analysis change made directly in code when the root cause was a specification issue that needed a SAP amendment.
  • The validation signed off with open discrepancy rows.

How to adapt this log

  1. Open one log per output or related output group, and fill the header before validation starts.
  2. Keep the field set; add columns only if your tooling captures more (for example a link to the exact compare-log line or commit).
  3. Route specification-level root causes to the statistician and record whether a SAP amendment resulted.
  4. Store the log with the rest of the validation package under version control, and confirm your retention period against the records schedule.
Use madhadi.com as an app Full screen, works offline, one tap from your home screen.