|
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
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.