1 def buffer nbc for NewBatch.
3 DEF VAR last-batch
AS INT NO-UNDO INITIAL 0.
4 DEF VAR first-month
AS INT NO-UNDO.
5 FIND LAST Month
WHERE Month.EndDate
< DATE(1,1,1993) NO-LOCK.
6 first-month
= Month.MonthCode.
7 MESSAGE "Finishing at month" first-month
", which is from" Month.StartDate
"to" Month.EndDate.
9 FOR EACH nbc
WHERE nbc.BatchCode
> last-batch
NO-LOCK WITH NO-BOX USE-TEXT:
10 DISPLAY nbc.batchcode
COLUMN-LABEL "Code" FORMAT "99999"
11 STRING( TIME, "HH:MM:SS") COLUMN-LABEL " Time".
12 FIND FIRST NewAcctTrans
OF nbc
NO-LOCK NO-ERROR.
13 IF AVAILABLE(NewAcctTrans
) THEN DO:
14 FIND FIRST NewAcctTrans
OF nbc
WHERE NewAcctTrans.MonthCode
> first-month
NO-LOCK NO-ERROR.
15 IF AVAILABLE(NewAcctTrans
) THEN NEXT.
16 RUN process\tru.r
( nbc.batchcode
, "delete,quiet,no-consequentials" ).
17 FIND LAST Batch
NO-LOCK NO-ERROR.
18 IF AVAILABLE(Batch
) THEN
19 DISPLAY Batch.BatchCode
COLUMN-LABEL "New Code" Batch.DocumentCount
COLUMN-LABEL "Count".
23 FIND NewBatch
WHERE RECID(NewBatch
) = RECID(nbc
) EXCLUSIVE-LOCK.