Go into your query and select 'Select records'
If the date field in your file is named MyFileDate then use a selection of 'MyFileDate EQ :input' (notice the colon before my made up name of input)
On the Specify Dependent Value Qualifiers panel specify '1' (Query) and type in the name of your query
Save your query
Run your query using the STRQMQRY command. If your query is name MyQuery and the date you want to pass for record selection is '022608' use:
STRQMQRY QMQRY(MYQUERY) ALWQRYDFN(*YES) SETVAR((INPUT '022608'))
Bruce Vining
<a href="http://www.brucevining.com/">http://www.brucevining.com/</a>
Last Wiki Answer Submitted: February 26, 2008 10:21 am by bvining6,055 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Pardon my French, Bruce, but that is some cool sheet! I’m a little embarrassed now thinking back to the times I said, “Can’t be done w/ Query/400″. Then I’d create a QM Query to do it. Or a HLL app. Or I’d create an input file to contain one record, fill that record w/ the parms dynamically , then have the query link up the “parm record” with the data I need.
This is good stuff. So I decided to play a little and came up w/ 2 questions regarding the method…
1.) Testing w/ a NAME field… I get an error on the comma when passing a name in LAST,FIRST format. Do you know of a workaround?
2.) In my testing (and after a reasonable amount of head-scratching and google-ing) I can’t seem to get dependent value qualifiers to work with LIKE and NLIKE comparison operators… any advice?
Slateken:
You’re right – not obvious how to use multiple parms.
Enter Bruce’s cmd WITH the SETVAR in place then hit F4.
Then F10 for Addl parameters.
Looks like you can enter as many as you want. And you’ll get the syntax after you hit enter.
Gary
How would the command be structured if the command is being called from a CL program using a variable in the setvar?
Bruce:
All the years I ran query (before replacing it with SQL), I never knew that existed. OY!
Great little piece of info.
Gary
Pardon my French, Bruce, but that is some cool sheet! I’m a little embarrassed now thinking back to the times I said, “Can’t be done w/ Query/400″. Then I’d create a QM Query to do it. Or a HLL app. Or I’d create an input file to contain one record, fill that record w/ the parms dynamically , then have the query link up the “parm record” with the data I need.
This is good stuff. So I decided to play a little and came up w/ 2 questions regarding the method…
1.) Testing w/ a NAME field… I get an error on the comma when passing a name in LAST,FIRST format. Do you know of a workaround?
2.) In my testing (and after a reasonable amount of head-scratching and google-ing) I can’t seem to get dependent value qualifiers to work with LIKE and NLIKE comparison operators… any advice?
Thanks for the great tip.
Slateken:
You’re right – not obvious how to use multiple parms.
Enter Bruce’s cmd WITH the SETVAR in place then hit F4.
Then F10 for Addl parameters.
Looks like you can enter as many as you want. And you’ll get the syntax after you hit enter.
Gary
Slateken:
re 1: You must enclose char-values in a set of triple quotes. For example:
SETVAR((NAME ”’SMITH”’)
re 2. Propably not supported… I’m as curious as you.
DanF
DanF and Gary: Thanks for the advice. Trip-quotes worked like a charm, Dan.
I’ll just stay in a holding pattern on the LIKE / NLIKE issue.