× 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.



On 27-May-2010 11:11, CRPence wrote:
On 25-May-2010 01:31, Gangasani, Bhargava wrote:

Using CLP I can read a specific RRN/ Key record using below code.

DCLF Z5PFILEP
OVRDBF FILE(Z5PFILEP) TOFILE(Z5PFILEP) +
POSITION(*RRN 4) SHARE(*NO)
RCVF

Question is: I can place my pointer at *END of file as

OVRDBF FILE(Z5PFILEP) TOFILE(Z5PFILEP) +
POSITION(*END) SHARE(*NO)

But How I can read the previous record. That is the Last record
of the file.


If the open can be shared, then write an RPG program<<SNIP>>

Another option would be to create a VIEW or use a *QMQRY to either INSERT, CREATE TABLE, or OUTPUT(*OUTFILE), from which a RCVF could get the value of MAX(RRN(Z5PFILEP)) which is the value from a SELECT. For example, a VIEW:

create view qtemp/z5pfilep_c (lastRRN) as
(select MAX(RRN(Z5PFILEP)) from Z5PFILEP)

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.