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



If the file does not get reorganized then you could try the following:

Create a data area which contains the record number of the last record
fro mthe last time the program ran.

In your program, retrieve this data area and do your ovrdbf spcifying
that record number

read until you reach the new end of file

Update the data area

For example

0000.01 DCL VAR(&LASTRECORD) TYPE(*DEC) LEN(9 0)
0000.02 DCL VAR(&INCREMENT) TYPE(*DEC) LEN(1 0) VALUE(0)
0000.03
0001.00 RTVDTAARA DTAARA(LASTRECORD) RTNVAR(&LASTRECORD)
0002.00 OVRDBF FILE(MYFILE) POSITION(*RRN &LASTRECORD)
0004.00
0005.00 READFILE:
0006.00 RCVF
0007.00 MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(EOF))
0008.00 CHGVAR VAR(&LASTRECORD) VALUE(&LASTRECORD +
0008.01 &INCREMENT)
0008.02 CHGVAR VAR(&INCREMENT) VALUE(1)
0009.00 CHGVAR VAR(&SAVEREC) VALUE(&MYREC)
0010.00 GOTO CMDLBL(READFILE)
0011.00 EOF:
0012.00 CHGDTAARA DTAARA(LASTRECORD) VALUE(&LASTRECORD)


On Wed, May 26, 2010 at 9:28 PM, Gangasani, Bhargava
<Bhargava.Gangasani@xxxxxxxxxxxxxx> wrote:

As of now in production it is reading through the file and running for long time just to pick up the LAST RECORD in the file (trailer).

As I need to validate trailer I want to read the last record in CLP program , as this is existing program and I do not want to go for new program (RPGLE).

Also I think I can not use CLF also, as this is external licensed tool.I do not think we buy it.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Albert York
Sent: Thursday, May 27, 2010 5:00 AM
To: Midrange Systems Technical Discussion
Subject: Re: READ PREVOIUS in CLP

If you need to do it in C/L simply read through the file and move the
record to a variable. When you are done the variable will contina the
last record.

Albert

On Wed, May 26, 2010 at 3:46 PM, Bruce Vining <bvining@xxxxxxxxxxxxxxx> wrote:
Vendor response.

Though the Control Language for Files (CLF) web site is experiencing some
problems right now, the Read Record using CLF (ReadRcdCLF) command directly
supports reading the *LAST record of a file (in addition to *PRV, *NXT,
*KEY, *RRN, etc). This can be done using the no-charge CLF run-time option
though productivity will be higher using the fee-based CLF precompiler.

Using CLF there is no need to write another program using a language such as
RPG or COBOL in order to do file operations.

Bruce Vining




On Wed, May 26, 2010 at 9:47 AM, DeLong, Eric <EDeLong@xxxxxxxxxxxxxxx>wrote:

That sounds like a REALLY BAD IDEA....  Sorry, but I think this would be
guaranteed to screw up if there are any deleted records in the file...

Why try to force this into CL, when that language is unable to support
your requirements?

Jmo,
-Eric

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Pat Barber
Sent: Wednesday, May 26, 2010 9:00 AM
To: Midrange Systems Technical Discussion
Subject: Re: READ PREVOIUS in CLP

It would take some screwing around but, by finding out the
record count of the file with a rtvobjd , you could position by record
count-1
and then do a  ovrdbf  with that record number.

Would be a tad messy but can be done.

Gangasani, Bhargava wrote:
Hi,

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.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




--
Regards,
Bruce
www.brucevining.com
www.powercl.com
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

2009 Winner: Broadridge receives “Top Overall Honors" for 2 consecutive years in the Black Book of Outsourcing Brokerage Process Service Provider Survey.  Learn more at http://www.broadridge.com/ranked1/



“THANK GOD IT’S MONDAY!” Sounds interesting? Know more @ www.broadridge.com.


This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.