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



Sorry, the information in my example is not clear. I will describe my
example more detail like this :
1. PGMA called by CL program 
   OVRDBF FILE(FILEA) TOFILE(*LIBL/FILEA) MBR(*FIRST) SHARE(*NO)         
   OPNDBF FILE(FILEA) OPTION(*ALL) TYPE(*PERM) 
   CALL   PGM(*LIBL/PGMA)

2. PGMB and PGMC used same file and read FILEA by key for different purpose,
like a function that return a value.
   In PGMB & PGMC not only read FILEA, but access some files and perform
something like calculation or another process.
   
Basicly, we can put procedure in PGMB and PGMC into PGMA. But if we do this,
then PGMA will be a big program and difficult to maintained.

Is the statement overriding file with share option equal 'NO' cause the
process to be slowly ? Because in my understanding, if share option = NO,
then for every program that open that file will be create new buffer.
For your information, we have about 200.000 record in FILEA.

Btw, Thank you very much for your advise .

rgds
Agus R


-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx]On Behalf Of
cobol400-l@xxxxxxxxxxxx
Sent: Thursday, April 14, 2005 9:37 PM
To: COBOL Programming on the iSeries/AS400
Subject: R: [COBOL400-L] Read same file


You may try to declare three times the same file in the same program, and
treat it as you like best.
E.g. 
  IDENTIFICATION DIVISION.
       PROGRAM-ID.  UNIQUE.

       SELECT FILEA-SEQ ASSIGN TO DATABASE-FILEA
           FILE STATUS IS STATUS-AS
           ACCESS MODE IS SEQUENTIAL
           ORGANIZATION IS SEQUENTIAL.
     
       SELECT FILEA-DYN ASSIGN TO DATABASE-FILEA
           FILE STATUS IS STATUS-AD
           ACCESS MODE IS DYNAMIC
           ORGANIZATION IS INDEXED
           RECORD KEY IS EXTERNALLY-DESCRIBED-KEY.

       SELECT FILEA-KEY
           ASSIGN TO DATABASE-FILEA
           FILE STATUS IS STATUS-AK
           ACCESS MODE IS DYNAMIC
           ORGANIZATION IS INDEXED
           RECORD KEY IS EXTERNALLY-DESCRIBED-KEY.

It seems that third file is treated same way than 2nd, but it problably
does'nt care.
It would be ACCESS RANDOM, may be ? 

In the program's body  you may the code:
 perform READ-FILEA-SEQ

 perform START-FILEA-DYN
 perform READ-FILEA-DYN-NXT
 perform READ-FILEA-DYN-key

and so on....



START-FILEA-DYN
        start FILEA-DYN key not less externally described key invalid key
continue end-start

READ-FILEA-DYN-NXT
        read filea-dyn next at end continue end-read

READ-FILEA-DYN-key
        read filea-dyn key externally-described-key invalid key  continue
end-read


Sincerely
        Domenico Finucci
        Sistemi informativi (SVI/SSI)
         Tel. + 39 02-43.01.2494, cell. 348 - 59.53.279
         Fiditalia S.p.A. via G. Silva, 34 - 20149 Milano
        E-mail: domenico.finucci@xxxxxxxxxxxx 
> Sito internet: www.fiditalia.it
> 



_______________________________________________
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.
IMPORTANT NOTICE: 

The information in this email (and any attachments) is confidential. 
If you are not the intended recipient, you must not use or disseminate the
information.
If you have received this email in error, please immediately notify me by
"Reply" command 
and permanently delete the original and any copies or printouts thereof. 
Although this email and any attachments are believed to be free of any virus
or 
other defect that might affect any computer system into which it is received
and opened, 
it is the responsibility of the recipient to ensure that it is virus free
and no responsibility 
is accepted by American International Group, Inc. or its subsidiaries or
affiliates either 
jointly or severally, for any loss or damage arising in any way from its
use.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.