× 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 made the same thing :
1- Yes
2- I export an external DS based on the file. (and import it into calling
PGM)
    Typically is use have one procedure by action :
        Read_filename (READ)
            parms     : *on/off (lock or not)
                          : '*NEXT', '*PRV' (read or readp)
                          : '*EQ'     (readE or readpE)
                          : Key1
                          : Key2 ....
        Exist_Filename (like a settl)
                          : KEY1
                          : Key2 ...
        Get_Filename (CHAIN)
        Delete_Filename

        Each procedure return a boolean (ok or not) and populate with read
operations the exported DS


3- a *SRVPGM remain open (active) until you endjob or rcl the activation
group it is running inside.
If you use OVRDBF, it may be usefull to ADD a parm to the PI with the
library of the file.
In your service PGM, you can add a global variable with current library of
the file, and a procedure that will test if the current library is the same
of the parm library if no, the close the file and open it.

It is the general idea, not tested it.
The important thing is that the file is still open after the first callp to
a procedure so the next call will use the same file i think.

NB : it works fine, but be carefull in a loop of  read_file calling a pgm
that have a get_file... pointer on records is changed !
        With exported DS you can't have a named activation group, you must
use *CALLER

Hope this help a little
----- Original Message ----- 
From: "Jeff Young" <cooljeff913@xxxxxxxxx>
To: <rpg400-l@xxxxxxxxxxxx>
Sent: Thursday, August 25, 2005 4:45 PM
Subject: Service Program DB Output


> I have the following questions regarding DB I/O in a service program.
>
> 1. Can all of the I/O functions (Open, Close / Read / Write) be done in
separate procedures?
> 2. If so, given that the Write function will be passed a data buffer, and
an OVRDBF command issued prior to calling the program that called the
Service Program that pointed the DB file to a file in the users QTEMP
library, will I have a confilct in the Service Program with multiple users
accessing it concurrently?
> 3. What special considerations must I be aware of if I attempt this.
>
> Thanks,
>
>
>
>
> Jeff Young
> Sr. Programmer Analyst
> Dynax Solutions, Inc.
> IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions
V5R2
> IBM  Certified Specialist- e(logo) server i5Series Technical Solutions
Designer V5R3
>
> IBM  Certified Specialist- e(logo)server i5Series Technical Solutions
Implementer V5R3
>
>
>
>
>
>
>
>
>
>
>
> ---------------------------------
>  Start your day with Yahoo! - make it your home page
> -- 
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.