Dan,

This is a classic CL programming problem.  Once you hit
end-of-file in CL (CPF0864), the file cannot be repositioned
within that occurrence of  the program.

I'm sure you'll here of a number of solutions, but the one that I
found works the best is to do a TFRCTL (Transfer Control) command
after your CL program reaches CPF0864.  A Transfer Control will
start a new occurrence of the program (and end the old
occurrence)  and allow the file to be reread at start.

In your particular case, you might also get by with repositioning
the file (with either a POSBDF or a OVRDBF) after each read (but
before the EOF CPF message is issued).  This will work as long as
there is always only one record in the file.

hth

jte


--
John Earl
johnearl@powertechgroup.com
The Powertech Group          www.powertechgroup.com
Seattle, Washington, USA    +1 253-872-7788


----- Original Message -----
From: Dan Rasch <drasch@mail.win.org>
To: <midrange-l@midrange.com>
Sent: Wednesday, December 26, 2001 09:14 AM
Subject: Re-reading a single record file in CLP


>
> I am trying to re-read a single record file in CLP.
>
> When I tried to RCVF in the program, I kept getting an error
> stating "End of file detected for file XAPURGP in REL003PURG."
> This was when I tried to read it the second time (and obviously
anytime
> after).  I tried using POSDBF, and other goodies, but nothing
worked.
>
> I had a deadline, and wrote a little ten line RPG program to
make
> it work, but felt there must have been a CL solution that
points
> back to the first (and only) record to read it again.  FYI, I
am
> testing for an end time to prevent another RGZPFM when the
users
> begin to shuffle in.
>
> TIA -
>
> Dan Rasch - because if the human species concentrated on the
really
> important things in life, there would be a shortage of fishing
poles!
> IBM Certified twice....... but still a couple PTFs away from
Nirvana.
>
> _______________________________________________
> This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list
> To post a message email: MIDRANGE-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
> or email: MIDRANGE-L-request@midrange.com
> 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-2022 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.