×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Those are "Host Variables" which represent a replacement for a column
result or compare value [as Simon already responded with a doc ref]. As
such, the use of a /host variable/ for a table name is not an option.
To use embedded SQL with a variable file name, code a bogus static file
name, and then use an override to route the open of the static name to
the variable\changing name. For example:
If the SQL program is already being called by a CLP, then something
like the above is a very simple change. If the active history library
name is stored somewhere, then that stored value can be updated as part
of the process of /renaming/ the history library, thus extracted versus
calculated in the sample CLP.
If not called by a CLP, then as a SQL RPG using a string for a
dynamic override request issued via QCMDEXC from within the RPG program,
setting a variable to the prior year to be concatenated into the
override command string would suffice just as well as within a CLP.
Probably easier in RPG, but generating the library name can even be done
easily in a SQL SET or SQL VALUES statement:
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.