Always sync unposted rprh batches

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>
This commit is contained in:
Paul Trowbridge 2026-08-18 23:48:22 -04:00
parent d5618e9514
commit 71034da312

View File

@ -53,4 +53,8 @@ SELECT
NWPDAT AS nwpdat, NWPDAT AS nwpdat,
NWPTIM AS nwptim NWPTIM AS nwptim
FROM LGDAT.RPRH 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}') WHERE NWPDAT >= DATE('{stamp}')
OR RTRIM(NWPOST) <> 'Y'