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



You need to declare &CHARJOB.
DCL &CHARJOB *CHAR 10

"Dale, Ian - EC Basingstoke" <ian.dale@xxxxxxxxxx> wrote:

Hi,
I'm trying to pass a parameter to a QMquery via STRQMQRY and I
thought I'd found the solution

Figure 66. Test Query SELECT Statement
DB2 for AS/400 Query Management

Query . . . . . . : SALARYQ3
Library . . . . : EXAMPLE
Text . . . . . . . : TEST QUERY
SEQNBR |...+....1....+....2....+....3....+....4....+....5....+....6....
000001 SELECT JOB,DEPT,NAME,ID,YEARS,SALARY,COMM
000002 FROM TESTDATA/STAFF
000003 WHERE JOB = &COND1 AND SALARY < &COND2
000004 ORDER BY JOB,SALARY
* * * * * END OF SOURCE * * *
The CL program in Figure 67
htm> uses the query shown in Figure 66
htm> .
Figure 67. CL Program Source File
SEU SOURCE LISTING
SOURCE FILE . . . . . . . EXAMPLE/SOURCE
MEMBER . . . . . . . . . CLPGM
SEQNBR*...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...
100 PGM PARM(&VAR1 &VAR2 &VAR3 &VAR4)
200 DCL &VAR1 *CHAR LEN(6)
300 DCL &VAR2 *CHAR LEN(6)
400 DCL &VAR3 *CHAR LEN(6)
500 DCL &VAR4 *CHAR LEN(10)
600 DCL &CHARJOB *CHAR LEN(10)
700 CHGVAR VAR(&CHARJOB) VALUE('' *TCAT &VAR1 *TCAT '''')
800 STRQMQRY QMQRY(EXAMPLE/SALARYQ3) QMFORM(EXAMPLE/&VAR4) +
900 OUTPUT(&VAR3) +
1000 SETVAR((COND1 &CHARJOB) (COND2 &VAR2))
1100 ENDPGM


* * * * E N D O F S O U R C E * * * *
This is at:
http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/rzala/r
zalamsg.html

But the CHGVAR above is illegal even though it's in an IBM manual!
Anybody any ideas on what I really need to pass a parameter similar to
this? I think I need to add a quote either side of the parameter and
yet not have the parameter end up in quotes.

Regards
Ian








************************************
This e-mail and any files transmitted with it are proprietary and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this e-mail in error please notify the sender. Please note 
that any views or opinions presented in this e-mail are solely those of the 
author and do not necessarily represent those of ITT Industries, Inc. The 
recipient should check this e-mail and any attachments for the presence of 
viruses. ITT Industries accepts no liability for any damage caused by any virus 
transmitted by this e-mail.
************************************
--
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.



Jeff Young 
Sr. Programmer Analyst
Dynax Solutions, Inc.
IBM -e(logo) server Certified Systems Exper - iSeries Technical Solutions V5R2 
IBM  Certified Specialist- e(logo) server i5Series Technical Solutions Designer 
V5R3

IBM  Certified Specialist- e(logo)server i5Series Technical Solutions 
Implementer V5R3

  
 







                
---------------------------------
Yahoo! Mail
 Stay connected, organized, and protected. Take the tour

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.