Like I said before...."I wouldn't go that far" saying RUNQRY is like SQL.
I do not see a way of doing what you want using qry/400
Using SQL can obviously do it but so can STRQM (query management qry).
Maybe someone else has an antiquated trick up their sleeve for this via qry/400 but I do not..and..it does not appear to be documented in that PDF either.
Original Message:
Sent: Thu March 06, 2025 08:13 AM
From: jerry ven
Subject: Runqry examples for list,value range etc.
Let's say we need to select all the distinct values for a field using this RUNQRY then how to get such records ? Like we get in SQL : Select distinct(field name) from file name.
Thanks...
Original Message:
Sent: Tue March 04, 2025 09:47 AM
From: Rich Malloy
Subject: Runqry examples for list,value range etc.
I don't know that I would go "that far" but if all you're interested in is selecting records from one or more files and putting the result set into an OUTFILE, Printer, or Display - then yes, you can use RUNQRY all day long for that, but..at some point..you may want to learn how to either use SQL or at least use Query Manager Queries instead of using QRY/400
System i: Query Management Programming
------------------------------
Rich Malloy
Principal Systems Engineer - IBMi
Cox Automotive
Draper UT
Original Message:
Sent: Tue March 04, 2025 09:24 AM
From: jerry ven
Subject: Runqry examples for list,value range etc.
Ok, Thanks.
So using RUNQRY can we do almost all the things which can be done using SQL queries inside STRSQL Session ?
Thanks...
Original Message:
Sent: Tue March 04, 2025 08:45 AM
From: Rich Malloy
Subject: Runqry examples for list,value range etc.
Jerry - That was the first example I gave you. It shows selecting values using a LIST for a field. You had wanted to have documentation on QRY/400...I gave you a link for it...Did you read the PDF or try searching for what you are asking. Your answer is on page 95-96.
------------------------------
Rich Malloy
Principal Systems Engineer - IBMi
Cox Automotive
Draper UT
Original Message:
Sent: Tue March 04, 2025 03:13 AM
From: jerry ven
Subject: Runqry examples for list,value range etc.
Thanks,
Let's say field1 from file1 having multiple values and j Wan to filter records based on these multiple values then using RUNQRY how can i select such records here any example for the same please?
Thanks...
Original Message:
Sent: Thu February 27, 2025 08:12 AM
From: Rich Malloy
Subject: Runqry examples for list,value range etc.
You can always use F1 to get more help when you are in the RUNQRY Record Selection. Put your cursor on the VALUE field, press F1 - and you'll see examples of how to do things. For details on ALL THINGS QRY/400 - see Query for i5/OS V6R1
------------------------------
Rich Malloy
Principal Systems Engineer - IBMi
Cox Automotive
Draper UT
Original Message:
Sent: Thu February 27, 2025 01:22 AM
From: jerry ven
Subject: Runqry examples for list,value range etc.
Thanks and what about other "value,like eq,ne etc. Examples " any IBM I documents link for the same ?
Thanks..
Original Message:
Sent: Wed February 26, 2025 08:59 AM
From: Rich Malloy
Subject: Runqry examples for list,value range etc.
Jerry
Here are a couple of examples


Hope this helps some - Rich
------------------------------
Rich Malloy
Principal Systems Engineer - IBMi
Cox Automotive
Draper UT
Original Message:
Sent: Wed February 26, 2025 04:02 AM
From: jerry ven
Subject: Runqry examples for list,value range etc.
Hi,
Any examples for Runqry examples for list,value range etc.
Thanks...
------------------------------
jerry ven
------------------------------