|
On Thu, 2005-09-01 at 18:30, Wall, Isa (ED) wrote: > I read your article on embedding file I/O in service program. Very > impressive. > > How would you deal with Paul's comment... > > "If you use service programs you will be sharing that file between > programs. The file would be opened once in the service program. If two > programs use that file (service program) but one program calls the other > program. The second program called from the first could do something > with the file (SETLL, READ, CLOSE) that interferes with the first > program." > > Isa My short answer, without a bunch of research, would be Activation Groups. If the Service Program runs in a named activation group, then Paul's scenario could be true, although I would think that careful design could still prevent any problems. If the service program runs in *CALLER, then each calling program has its own copy of the file handles and such and they should not interfere with one another. Now, if you are messing with *JOB level overrides or something, you might have to pay extra attention to what you do. There may be exceptions to this, I'm sure some (calling Jon Paris!) will chime in with more, but that's all I have time for right now... Joel Cochran http://www.rpgnext.com > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Joel Cochran > Sent: Thursday, September 01, 2005 9:07 AM > To: RPG programming on the AS400 / iSeries > Subject: RE: Subprocedure Question > > On Thu, 2005-09-01 at 17:38, Joel Fritz wrote: > > It's just my opinion, but I don't see much benefit in externalizing > file > > I/O in RPG. You have to hard code the file name and/or record format > > name. It's true you may not have to recompile as many programs when > you > > change a file, but there is the effort involved in creating the I/O > > routines. The key is how often files are changed vs the effort > necessary > > to create the I/O modules. > > I suppose now would be as good a time as any to mention that I have a > free, open-source tool that will create most (if not all, depending on > your desired sophistication level) of the externalizing I/O routines for > any physical file. You may download the tool at http://www.rpgbeans.com > (it does require the also-free but not open-source "xRPG Core Library" > from http://www.rpgnext.com). > > And if you are interested in Encapsulation using RPG and Service > programs, check out these two articles: > > http://www.midrangeserver.com/fhg/fhg072104-story01.html > http://www.itjungle.com/fhg/fhg011205-story01.html > > And for good measure, a link to the rest of my articles (should help > with questions about binding directories, service programs, and such) > > http://www.rpgnext.com/tutorials.php > > HTH, > > Joel Cochran > http://www.rpgnext.com > > -- > 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 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.