A little over a year ago, I wrote a program with the MAIN keyword and
local files just to have a go. Just dug it out. It's still the only
program on the system, so noone else can be very impressed. Reading
through, I thought it was good that each file was only used in one
place, ie, the sub-procedure. 'Til I found that one file had been
declared globally, presumably because it was needed by more than one
procedure. A java guy told me he declared everything as local then
changed to global whenever it was needed. I think when someone looks
at my code and sees one file in the F specs, he'll probably miss the
local file definitions the first time. I don't think it'll catch on
here as it needs more work to put in place. Same as SQL cursors.

2012/7/30 <rob@xxxxxxxxx>:
While I am not in the "if you're using a cursor you're doing it wrong"
camp I still do not think that all I/O should be done via SQL. I mix and
match.


Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Alan Campin <alan0307d@xxxxxxxxx>
To: "RPG programming on the IBM i / System i" <rpg400-l@xxxxxxxxxxxx>,

Date: 07/27/2012 03:31 PM
Subject: Re: Defining Files locally in Sub-Procedures - What
advantages has everyone found doing it that way?
Sent by: rpg400-l-bounces@xxxxxxxxxxxx



I would ask a higher level question. Is it time to move to SQL? With
all the advantages and power of modern SQL I would question continuing
to use files.

On Fri, Jul 27, 2012 at 12:52 PM, Andy Hautamaki
<ahautamaki@xxxxxxxxxxxxxxx> wrote:
Our shop is going to be moving from V5R4 to V7 in a few months so I can
finally start using the enhancements in V6 and V7.

The idea of being able to define the files in Sub-Procedures instead of
globally in a module I was thinking would be very cool. Then I got to
thinking when would I really need to do that? When has everyone else
been
finding it was a better idea to define the files in a sub-procedure?

I was reading about how the file will be closed without it having the
static keyword. When would it be better to use the static versus not? If
your using the sub-procedure repeatedly the open and closing of the file
seems like a reason to be using the static. Interesting idea that you
could
be getting different records for the same file in different
sub-procedures.

Thanks
Andy
--
This is the RPG programming on the IBM i / System i (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.

--
This is the RPG programming on the IBM i / System i (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.


--
This is the RPG programming on the IBM i / System i (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.