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



Here's a bit of old code I've used to convert native query / QMQRY to QSQLSRC.
Ugly maybe but it works.
You'll have to create SRCPF QSQLSRC/QGPL or whatever you like.
Run the program.
QSQLSRC will contain a src member for each query / qmqry.
Take a src member and copy it to either STRSQL or ACS SQL.
Note in SQL: Library/File becomes Schema.Table. (slash becomes period).


500 /*******************************************************************/
525 PGM 12/23/14
600 DCLF FILE(QADSPOBJ) 12/23/14
700 /*******************************************************************/ 12/23/14
800 /* PRODUCE OUTPUT FILE OF ALL QUERY DEFINITIONS */ 12/23/14
900 DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*QRYDFN *QMQRY) + 08/25/17
1000 OUTPUT(*OUTFILE) OUTFILE(QGPL/QRYLIST) 08/25/17
1100 /*******************************************************************/ 12/23/14
1200 /* OVERRIDE QADSPOBJ - SYSTEM SUPPLIED OUTFILE FOR DSPOBJD COMMAND */ 12/23/14
1300 /* TO QRY MGMT QUERY SOURCE */ 12/23/14
1400 /*******************************************************************/ 12/23/14
1500 OVRDBF FILE(QADSPOBJ) TOFILE(QGPL/QRYLIST) 12/23/14
1600 LOOP1: 12/23/14
1700 RCVF 12/23/14
1800 MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(LOOP2)) 12/23/14
1900 /*******************************************************************/ 12/23/14
2000 /* FOR EACH QUERY IN LIST (OUTFILE), RETRIEVE DEFINITION AS QUERY */ 12/23/14
2100 /* MGMT QUERY SOURCE */ 12/23/14
2200 /*******************************************************************/ 12/23/14
2300 RTVQMQRY QMQRY(&ODLBNM/&ODOBNM) + 12/23/14
2400 SRCFILE(QGPL/QSQLSRC) ALWQRYDFN(*YES) 12/23/14
2500 GOTO CMDLBL(LOOP1) 12/23/14
2600 LOOP2: 12/23/14
2700 DLTOVR FILE(*ALL) 12/23/14
2800 ENDPGM 12/23/14
2900 /*******************************************************************/


Respectfully,
Michael Mayer
IBM i on Power System Admin
Cell: 518.641.8906
Office and On Call: 731-676-4318
https://www.ermco-eci.com<https://www.ermco-eci.com/>
IBM i Blog: https://ibmireference.blogspot.com<https://ibmireference.blogspot.com/>




Today's Topics:

1. Running a QRYDFN using STRQMQRY to pass the parameters (a4g atl)
2. RE: [External] Running a QRYDFN using STRQMQRY to pass the
parameters (Michael Mayer)
3. RE: [External] Running a QRYDFN using STRQMQRY to pass the
parameters (Michael Mayer)
4. RE: [External] Running a QRYDFN using STRQMQRY to pass the
parameters (webster@xxxxxxxxxxxxxx)


----------------------------------------------------------------------

message: 1
date: Mon, 30 Jan 2023 16:48:12 -0500
from: a4g atl <a4ginatl2@xxxxxxxxx>
subject: Running a QRYDFN using STRQMQRY to pass the parameters

I've read a few places that this can be done, saving one having to convert a QRYDFN to a QMQRY.
I have tried to find examples on how to do this, but have not had success.
The examples I find show the QRYDFN being run but there are steps missing, it appears. I need to keep the QRYDFN's as the users create the reports. I am trying to schedule the queries in the scheduler passing from and to dates.

Does anyone know how to do this?

TIA, Darryl Freinkel


------------------------------

message: 2
date: Mon, 30 Jan 2023 21:47:00 +0000
from: Michael Mayer <michael.mayer@xxxxxxxxxxxxx>
subject: RE: [External] Running a QRYDFN using STRQMQRY to pass the
parameters

Somewhere I have a link to this from IBM ..... give me a few minutes and I'll find it and post it.
MM

Respectfully,
Michael Mayer
IBM i on Power System Admin
Cell: 518.641.8906
Office and On Call: 731-676-4318
https://www.ermco-eci.com<https://www.ermco-eci.com/>
IBM i Blog: https://ibmireference.blogspot.com<https://ibmireference.blogspot.com/>


[cid:image001.gif@01D934C2.164DAF70]

From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of a4g atl
Sent: Monday, January 30, 2023 3:48 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: [External] Running a QRYDFN using STRQMQRY to pass the parameters

Caution: This message originated outside your organization from email address midrange-l-bounces@xxxxxxxxxxxxxxxxxx<mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx>. Ensure you were expecting this email before opening links or attachments.

I've read a few places that this can be done, saving one having to convert a QRYDFN to a QMQRY.
I have tried to find examples on how to do this, but have not had success.
The examples I find show the QRYDFN being run but there are steps missing, it appears. I need to keep the QRYDFN's as the users create the reports. I am trying to schedule the queries in the scheduler passing from and to dates.

Does anyone know how to do this?

TIA, Darryl Freinkel
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l<https://lists.midrange.com/mailman/listinfo/midrange-l>
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx>
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l<https://archive.midrange.com/midrange-l>.

Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.


The information in this email may be confidential. It is intended only for the person(s) named above. If you are not the intended recipient, please notify the sender and do not review, distribute, or duplicate this email.


------------------------------

message: 3
date: Mon, 30 Jan 2023 22:08:54 +0000
from: Michael Mayer <michael.mayer@xxxxxxxxxxxxx>
subject: RE: [External] Running a QRYDFN using STRQMQRY to pass the
parameters

Here's an oldie but a goodie from the master Simon Hutchinson.
This might help a bit.
https://www.rpgpgm.com/2013/07/passing-parms-to-query.html


Respectfully,
Michael Mayer
IBM i on Power System Admin
Cell: 518.641.8906
Office and On Call: 731-676-4318
https://www.ermco-eci.com<https://www.ermco-eci.com/>
IBM i Blog: https://ibmireference.blogspot.com<https://ibmireference.blogspot.com/>


[cid:image001.gif@01D934C5.256AD3E0]

From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of a4g atl
Sent: Monday, January 30, 2023 3:48 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: [External] Running a QRYDFN using STRQMQRY to pass the parameters

Caution: This message originated outside your organization from email address midrange-l-bounces@xxxxxxxxxxxxxxxxxx<mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx>. Ensure you were expecting this email before opening links or attachments.

I've read a few places that this can be done, saving one having to convert a QRYDFN to a QMQRY.
I have tried to find examples on how to do this, but have not had success.
The examples I find show the QRYDFN being run but there are steps missing, it appears. I need to keep the QRYDFN's as the users create the reports. I am trying to schedule the queries in the scheduler passing from and to dates.

Does anyone know how to do this?

TIA, Darryl Freinkel
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l<https://lists.midrange.com/mailman/listinfo/midrange-l>
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx>
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l<https://archive.midrange.com/midrange-l>.

Please contact support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.


The information in this email may be confidential. It is intended only for the person(s) named above. If you are not the intended recipient, please notify the sender and do not review, distribute, or duplicate this email.


------------------------------

message: 4
date: Mon, 30 Jan 2023 15:59:37 -0600
from: <webster@xxxxxxxxxxxxxx>
subject: RE: [External] Running a QRYDFN using STRQMQRY to pass the
parameters

Retrieve Query Mgmt Query (RTVQMQRY)

Blessings,
Davey Webster


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Michael Mayer
Sent: Monday, January 30, 2023 3:47 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: [External] Running a QRYDFN using STRQMQRY to pass the parameters

Somewhere I have a link to this from IBM ..... give me a few minutes and I'll find it and post it.
MM

Respectfully,
Michael Mayer
IBM i on Power System Admin
Cell: 518.641.8906
Office and On Call: 731-676-4318
https://www.ermco-eci.com<https://www.ermco-eci.com/>
IBM i Blog:
https://ibmireference.blogspot.com<https://ibmireference.blogspot.com/>


[cid:image001.gif@01D934C2.164DAF70]

From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of a4g atl
Sent: Monday, January 30, 2023 3:48 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: [External] Running a QRYDFN using STRQMQRY to pass the parameters

Caution: This message originated outside your organization from email address midrange-l-bounces@xxxxxxxxxxxxxxxxxx<mailto:midrange-l-bounces@lists.midran
ge.com>. Ensure you were expecting this email before opening links or attachments.

I've read a few places that this can be done, saving one having to convert a QRYDFN to a QMQRY.
I have tried to find examples on how to do this, but have not had success.
The examples I find show the QRYDFN being run but there are steps missing, it appears. I need to keep the QRYDFN's as the users create the reports. I am trying to schedule the queries in the scheduler passing from and to dates.

Does anyone know how to do this?

TIA, Darryl Freinkel
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L@xxxxxxxxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l<https://lists.midrang
e.com/mailman/listinfo/midrange-l>
or email:
MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx<mailto:MIDRANGE-L-request@lists.midran
ge.com>
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l<https://archive.midrange.com/midrang
e-l>.

Please contact
support@xxxxxxxxxxxxxxxxxxxx<mailto:support@xxxxxxxxxxxxxxxxxxxx> for any subscription related questions.


The information in this email may be confidential. It is intended only for the person(s) named above. If you are not the intended recipient, please notify the sender and do not review, distribute, or duplicate this email.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.



------------------------------

Subject: Digest Footer

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) digest list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.



------------------------------

End of MIDRANGE-L Digest, Vol 22, Issue 64
******************************************

________________________________
Please note: Florida has very broad public records laws. Many written communications to or from The Florida Bar regarding Bar business may be considered public records, which must be made available to anyone upon request. Your e-mail communications may therefore be subject to public disclosure.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.