Hi Bill

Which SQL commands did you enter? I know that I offered CL commands - nothing SQL-ish. One of those CL commands, RTVQMQRY, gives you a direct way to put converted QRYDFN into a source member - no SQL needed.

I don't know anything about Michael Mayer's offering - he said it's an SQL something - please let us know if that's what you tried.

Now just another thought - in RSS you can type in this -

CL: RTVQMQRY with its parameters and get the source. And, of course, you can use something like the QCMDEXC scalar function with one of the "list object"SQL services to run RTVQMQRY against a list - here's an example of using the QCMDEXC scalar function, just different SQL service -

SELECT JOB_NAME,
       CASE WHEN QSYS2.QCMDEXC('QSYS/HLDJOB ' CONCAT JOB_NAME) = 1 THEN 'Job Held'
            ELSE 'Job not held'
         END AS HLDJOB_RESULT
  FROM TABLE (QSYS2.ACTIVE_JOB_INFO (DETAILED_INFO=> 'ALL'))
  WHERE SQL_STATEMENT_START_TIMESTAMP < CURRENT TIMESTAMP - 2 HOURS;

You would use *SELECT * FROM TABLE (QSYS2.OBJECT_STATISTICS('*ALLUSR ','QRYDFN') )
*
instead of ACTIVE_JOB_INFO and build up the RTVQMQRY command from relevant columns . Your SELECT here could give you success/failure results, too, similar to the example.

*Regards*

*Vern Hamberg*

IBM Champion 2025 <cid:part1.VFeV2bsL.mGQhPVZK@centurylink.net> CAAC (COMMON Americas Advisory Council) IBM Influencer 2023

On 7/16/2025 4:08 PM, Glenn Gundermann wrote:
Share the query and sql code and we can try to find your mistake.Yours truly,GlennGundermannglenn.gundermann@xxxxxxxxx(416) 317-3144
-------- Original message --------From: Bill and Lisa Howie<blhowie66@xxxxxxxxxxx> Date: 2025-07-16 4:14 p.m. (GMT-05:00) To:midrange-l@xxxxxxxxxxxxxxxxxx Subject: RE: Query/400 converted to SQL So here's an interesting development on this....I tried both the methods suggested for converting a Query/400 query into SQL statements.  Plugged both SQL statements into Run SQL Statements in ACS, and in both cases got no results, where if I run the Query/400 query interactively I get 4 records of output.  Thoughts?Bill-- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing listTo post a message email:MIDRANGE-L@lists.midrange.comTo subscribe, unsubscribe, or change list options,visit:https://lists.midrange.com/mailman/listinfo/midrange-lor email:MIDRANGE-L-request@lists.midrange.comBefore posting, please take a moment to review the archivesathttps://archive.midrange.com/midrange-l.Please contactsupport@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.


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