× 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.



SETVARs are case-sensitive - be sure that the variable is &Q and not &q in the QMQRY source. Someone said that lowercase variables will always prompt. This is true if you do not force them to lowercase in STRQMQRY - remember, a lowercase value without apostrophes is actually uppercase when passed.

Consider this example:

select * from &l/&f

in a QMQRY called SETVARCASE

STRQMQRY QMQRY(SETVARCASE) SETVAR((l 'QIWS') (f 'QCUSTCDT'))

will prompt you. Actually, the SETVAR elements you specified are ignored because they do not match the names in the QMQRY. However, consider

STRQMQRY QMQRY(SETVARCASE) SETVAR(('l' 'QIWS') ('f' 'QCUSTCDT'))

which does not prompt you.

Actually, the command help is wrong in this matter. Here is what it says:

Because lower-case characters in variable names are changed to upper-case characters when passed to the command processing program, you cannot use this parameter to set values for variables with mixed case names.

But try this

select * from &Library/&File

in a QMQRY called TSTMXDCASE.

Then use

strqmqry tstmxdcase setvar(('Library' 'qiws') ('File' 'qcustcdt'))

which works fine. So the rule is not, they must be uppercase in the QMQRY, the rule is that the case must match. It's just a little more error-free to use uppercase in the QMQRY. But you get lots more flexibility with mixed-case. Of course, you only have 50 to use anyway. ;-)

HTH
Vern

At 04:49 PM 9/26/2005, you wrote:

   Hello,

   I've been searching IBM info center,and the list archive for a few hours
   now, and I can't see if what I want to do can be done.

   I have a QMQry that has parms passed to it.  CL is as follows.

                DCL        VAR(&Var1) +
                            TYPE(*CHAR) +
                            LEN(9)

                DCL        VAR(&Q) +
                            TYPE(*CHAR) +
                            LEN(1) +
                            VALUE('''')

                STRQMQRY   QMQRY(NameOQry) +
                            QMFORM(*QMQRY) +
                            SETVAR((Variable1 &Var1) (q &q))

   The Var1 is passed to the program as character.

   What I want is for the qry to run with the passed  parms, but when it is
   run in an interactive job, I get prompted for the variables Var1, and
   'Q'.

   Anyone know how to make it use the passed parms with running
   interactively?

   Thanks!


----------------------------------------------------------------------------------------------
   Jim Essinger
   Senior Programmer/Analyst
   UnLtd Support Services
   PO Box 730
   Fruitland ID 83619
   208-452-4058 Ext 133

----------------------------------------------------------------------------------------------
--
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.


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.