|
The file (it is a PF) looks like this.
NTAPPTYP A 1
NTAPPCDE A 10
NTSEQNBR P 5 0
NTAUTOCD A 4
NTNOTE A 75
NTUSERID A 10
NTWRKSTN A 10
NTRCDCCC S 2 0
NTRCDYYY S 2 0
NTRCDMMM S 2 0
NTRCDDDD S 2 0
NTRCDTIM S 6 0
There are over 3 million records in it.
In the program I have already found and deleted records. NTAPPTYP is a
"type" of Record and NTAPPCDE is a customer number. Each customer may
have
have 1 or several hundred records. I am trying to re-sequence NTSEQNBR
within the record type and customer number
This is what i tried. (Count is INZ at 1)
Reset Count;
exec sql
Declare C2 cursor for
Select NTAPPTYP, NTAPPCDE, NTSEQNBR
FROM NOTESNT
Where NTAPPTYP = :APPTYP and
NTAPPCDE = :OldAppCde
ORDER BY NTAPPTYP, NTAPPCDE, NTSEQNBR;
Dow Sqlstate = ErrStateOk;
If Sqlstate = ErrStateNoRow;
Leave;
endIf;
exec sql
fetch C2 Into :APPTYP, :APPCDE, :SEQNBR;
exec sql
Update misrabgbr/notesnt
Set NTSEQNBR = :Count
Where NTAPPTYP = :APPTYP and
NTAPPCDE = :APPCDE;
Count +=1;
EndDo;
ENDSR;
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.