NWPDAT stays 0001-01-01 until a batch posts, so the watermark branch alone can never see an in-flight batch -- it only appears once posting stamps a real date. Only 4 rows are unposted, so the whole set now comes over every run. Found by reconcile: dest and source tied on count but five numeric sums differed, which resolved to a single row pair -- an unposted batch missing from the dest, and one stale row for a batch purged upstream (deleted separately, since delete-by-key cannot remove it). The resolver still has no lookback, so a back-dated post below the high-water stays invisible; posting stamps the current date, so this only matters for a genuinely back-dated one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
61 lines
1.4 KiB
SQL
61 lines
1.4 KiB
SQL
SELECT
|
|
NWBTID AS nwbtid,
|
|
NWLABL AS nwlabl,
|
|
NWBPRT AS nwbprt,
|
|
NWPOST AS nwpost,
|
|
NWFSYY AS nwfsyy,
|
|
NWFSPP AS nwfspp,
|
|
NWRDAT AS nwrdat,
|
|
NWTMZN AS nwtmzn,
|
|
NWSHFT AS nwshft,
|
|
NWSHGP AS nwshgp,
|
|
NWNXT# AS nwnxt#,
|
|
NWCRBY AS nwcrby,
|
|
NWCDAT AS nwcdat,
|
|
NWCTIM AS nwctim,
|
|
NWUPBY AS nwupby,
|
|
NWUDAT AS nwudat,
|
|
NWUTIM AS nwutim,
|
|
NWIUSE AS nwiuse,
|
|
NWSRCE AS nwsrce,
|
|
NWSTKL AS nwstkl,
|
|
NWSCPR AS nwscpr,
|
|
NWIUCN AS nwiucn,
|
|
NWAPFC AS nwapfc,
|
|
NWAPCP AS nwapcp,
|
|
NWFUT1 AS nwfut1,
|
|
NWFUT2 AS nwfut2,
|
|
NWFUT3 AS nwfut3,
|
|
NWFUT4 AS nwfut4,
|
|
NWFUT5 AS nwfut5,
|
|
NWFUT6 AS nwfut6,
|
|
NWFUT7 AS nwfut7,
|
|
NWFUT8 AS nwfut8,
|
|
NWFUT9 AS nwfut9,
|
|
NWFLG1 AS nwflg1,
|
|
NWFLG2 AS nwflg2,
|
|
NWFLG3 AS nwflg3,
|
|
NWPLNT AS nwplnt,
|
|
NWEDILN AS nwediln,
|
|
NWEDILE AS nwedile,
|
|
NWSHFS AS nwshfs,
|
|
NWFLBH AS nwflbh,
|
|
NWOBTID AS nwobtid,
|
|
NWFUT10 AS nwfut10,
|
|
NWFUT11 AS nwfut11,
|
|
NWFUT12 AS nwfut12,
|
|
NWFUT13 AS nwfut13,
|
|
NWFUT14 AS nwfut14,
|
|
NWFUT15 AS nwfut15,
|
|
NWFUT16 AS nwfut16,
|
|
NWFUT17 AS nwfut17,
|
|
NWPUSR AS nwpusr,
|
|
NWPDAT AS nwpdat,
|
|
NWPTIM AS nwptim
|
|
FROM LGDAT.RPRH
|
|
-- NWPDAT is 0001-01-01 until the batch posts, so the watermark branch alone can
|
|
-- never see an in-flight batch -- it only appears once posting stamps a real
|
|
-- date. Only 4 rows are unposted, so the whole set comes over every run.
|
|
WHERE NWPDAT >= DATE('{stamp}')
|
|
OR RTRIM(NWPOST) <> 'Y'
|