× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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;

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.