|
Hello,list
I have done that (or at least something quite close). I had a similar
challenge in the early 90's when we implemented level checking. I had to
devise a way to add filed to a file without creating a level check while
leaving level checking on.
Here is what you could do.
- For the first time, you will still need exclusive access to the file
- you had one big alpha field to the file (1000 char. or more)
- you recompile the file and all programs that use it
Now you are set so you can had fields o the fly.
- You define an external data structure (basically a PF with no data in
it) that redefine the big alpha filed added earlier
- You use that external DS in the D spec of the program to overlay the
big field
-- This way, there is no level checking being done on the external data
structure since it is not on the F spec
- When you need a new field, you just modify the external data
structure, recompile it (it is never locked)
-- be sure to add new fields at the end and to never move a field.
- then you create a one shot program to initialize the new field
(putting all "0" in it or whatever)
- you must only recompile the programs that access that new fileds.
Of course, there are some limitation to this technique. The biggest is
that no filed added can be part of a key.
I do not recommend this method anymore, but it does achieve what you
want:
- Can add filed to a file while it is locked
- The only programs that need to be freed and recompile are those using
the new fields
- imply very little change to all existing program
I hope this make sense to you.
Denis Robitaille
Directeur services technique TI
819 363 6130
SUPPORT
Jour (EST) Daytime : 819-363-6134
En-dehors des heures (EST) After hour : 819-363-6158
Network Status : 819-363-6157
Hi guysAlan Shore <AlanShore@xxxxxxxx> 2009-05-09 13:18 >>>
I've just been asked the following question by my boss's boss
Is there anyway to add new fields (columns) "on the fly" to an
existing
file, without having an exclusive lock on that file.
In other words, the file is still being used while the field is added
I know that chgpf is out of the question (unless someone proves me
wrong).
I know that SQL is also out of the question (ALTER TABLE x ADD
EXTRAFIELD
DEC(7, 2) NOT NULL DEFAULT 0) - again unless someone proves me wrong
If anyone knows of any way, any language, any procedure, any function
to
achieve this, please drop me a line.
Thanks in advance
Alan Shore
Programmer/Analyst, Distribution
E:AShore@xxxxxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-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.