At 10:37 AM 10/10/97 -0400, Booth Martin wrote:
>on 10/10/97at 08, the Great and Grand Wazir DennisLovelady@kemet.com
>(Dennis Lovelady) said:
>
>Since the
>possibility (however slight) exists that the record changed, I personally
>prefer the "read into DS" option.
>
>Isn't the possibility far greater than slight? Tim said this is a heavily
>used file. The idea of reading a record, testing it, and if chosen,
>rereading the record and updating it is a really quick way to read a file.
>The chances are very good that it will arrive at almost every single
>record that is already out on other workstations and read it. This could
>lead to a lot of conflicts I think.

This, IMO, really pushes me toward Walden's solution of using SQL. That's a really nice use of the update statement. Tim, if you don't have the SQL licensed product installed, you can still do this by creating a query management (*QMQRY) and then execute STRQMQRY from a CL or whatever. Here's how to do it so that you don't even have to hard-code the file and field names:

1. Create a source file called QQMQRYSRC, record length 91 (really!).

2. Add a member to QQMQRYSRC, say UPPER.

3. Put the following statement in the source member:

update &file set &field = upper(&field) where &field <> upper(&field)

This uses replacement variables &file and &field. These are what takes away the hard-coding. Later you'll execute STRQMQRY and specify values for these variables. Anything you put there simply replaces the variable. Therefore, you can even put in a qualified filename.

4. Create the *QMQRY:

CRTQMQRY QMQRY(somelib/UPPER) SRCFILE(somelib/QQMQRYSRC) SRCMBR(UPPER)

5. Assuming an appropriate library list, run the statement with

STRQMQRY QMQRY(UPPER) SETVAR((FILE filename) (FIELD fieldname))

6. You can use this in a CL, which could even be the command processing program for something like

CVT2UPR FILE(filename) FIELD(fieldname)

In this case, the STRQMQRY command could be

STRQMQRY QMQRY(UPPER) SETVAR((FILE &FILE) (FIELD &FIELD))

Good luck

Vernon Hamberg
Systems Software Programmer
Old Republic National Title Insurance Company
400 Second Avenue South
Minneapolis, MN 55401-2499
(612) 371-1111 x480


+--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to "MIDRANGE-L@midrange.com". | To unsubscribe from this list send email to MAJORDOMO@midrange.com | and specify 'unsubscribe MIDRANGE-L' in the body of your message. | Questions should be directed to the list owner/operator: david@midrange.com +---

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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 here. If you have questions about this, please contact [javascript protected email address].