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



I goofed in my reply, thinking that Ken was the originator of this thread.
Some of my comments were specific to the original question, rather than one
that may have been posed by Ken.

Ken, you mention that:

> You are correct that POSITION(*START) is not required.
> My OVRDBF did not show POSITION(*START), only SHARE(*YES).

I apparently never saw that code, and I cannot find it in the archives.
Hence my confusion.

I cannot properly address, then, the question posed by you, that is unless
you re-post.

With regards to the original question, the code I have supplied, and whose
integrity I defend, should work nicely for you, Martin.

That original question, from Martin Rowe, is summarized here:

> Is CL incapable
> of re-reading earlier records? I know the caveat that you can't
> re read after hitting the end of file, but I'm nowhere near that
> point. For now I've split it into two programs, but I don't see
> why it can't be just the one. I did see mention of POSDBF in the
> archives, which I'll try tomorrow, but can anyone shed any light
> on this?

HTH
Dennis




|---------+-------------------------------------------------->
|         |           Ken Sims <mr3111@xxxxxxxxx>            |
|         |           Sent by:                               |
|         |           midrange-l-bounces+dlovelady=dtcc.com@x|
|         |           idrange.com                            |
|         |                                                  |
|         |                                                  |
|         |           06/20/2003 09:43 PM                    |
|         |           Please respond to Midrange Systems     |
|         |           Technical Discussion                   |
|         |                                                  |
|---------+-------------------------------------------------->
  
>---------------------------------------------------------------------------------------------------------|
  |                                                                             
                            |
  |        To:      midrange-l@xxxxxxxxxxxx                                     
                            |
  |        cc:                                                                  
                            |
  |        Subject: Re: re-reading records in CL (not after EOF!)               
                            |
  
>---------------------------------------------------------------------------------------------------------|




Hi Dennis -


>> >Elimiate the OPNDBF command - you don't need it.  On first read, RCVF
will
>> >implicitly open the file
>>
>>The OPNDBF is required to be able to use POSDBF to reposition the file.
>>
>Ummm... not unless they've changed the rules.

You do need OPNDBF (or OPNQRYF) to use POSDBF.  Your method doesn't require
OPNDBF because your method doesn't use POSDBF.

>If the file is opened by the OPNDBF command, this open operation is not
>used by the Receive File (RCVF)

It isn't automatically, but it is if you use OVRDBF with SHARE(*YES).

>First off, OVRDBF POSITION(*START) has always seemed like a silly value to
>me.  Where else would one expect it to begin processing?

You are correct that POSITION(*START) is not required.  My OVRDBF did not
show POSITION(*START), only SHARE(*YES).

>Secondly, you don't have to use explicit open in order to effectuate your
>OVRDBF command.

I don't know what you mean by "effectute".  If you don't use OPNDBF and
POSDBF then you don't need the override with SHARE(*YES) at all.

>Finally, as I said, reclaiming resources and issuing another read will
>cause the program to read FROM THE BEGINNING OF THE FILE.  (If I didn't
say
>it, I meant it.....)

I've never heard that before, but I wouldn't use that method anyway for at
least three reasons that I can think of right now:

1. RCLRSC *CALLER may have unintended consequences.

2. Unless this is documented, it could change in a future release, whereas
using a shared ODP won't.

3. That method only allows you start at the beginning of the file.  If you
want to get creative, you can use OVRDBF with SHARE(*YES) and different
POSITION values with OPNDBF and CLOF to give you the CL equivalent of
SETLL.

Of course personally I wouldn't do this kind thing of CL at all.  I'd do it
in RPG IV.

Ken
http://www.ke9nr.net/





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.