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



Someone mentioned SQL - IBM have added a scalar-function version of QCMDEXC that let's us run CL commands __within__ a SELECT statement. It even has a return code, so you can document what happened, the example below shows that.

Simon Hutchinson has posted an article with step-by-step processing - this is a game-changer in many ways.

https://www.rpgpgm.com/2021/06/qcmdexc-scalar-function-added-to-sql.html

There is likely a GIST from Scott Forstie, as well, on this.

There is also a simple example in the RSS examples -

-- category: IBM i Services
-- description: Application - QCMDEXC scalar function
--

--
-- Hold any jobs that started running an SQL statement more than 2 hours ago.
--
select JOB_NAME,
case
when QSYS2.QCMDEXC('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;

Cheers
Vern

----- Original Message -----
From: "Jim Oberholtzer" <midrangel@xxxxxxxxxxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxxxxxxxx>
Sent: Monday, January 31, 2022 11:55:03 AM
Subject: Re: Mass CHGOBJOWN without DLTUSRPRF?

I was just about to suggest just that. CHGOWN.

if you wish to get a bit more detailed, you can push the objects owned into
a file and process the the file, It'll take a bit longer but it's more
granular. Clearly you could edit the file before hand as well.

--
Jim Oberholtzer
Chief Technical Architect
Agile Technology Architects


On Mon, Jan 31, 2022 at 11:41 AM mlazarus <mlazarus@xxxxxxxxxxxx> wrote:

Justin,

You should be able to use the CHGOWN command. You need to use the IFS
path syntax (/qsys.lib/yourlib.lib/*.*), but it does allow wildcards. I
haven't tried to see if it will allow also putting a wildcard in the
library portion.

-mark

On 1/31/2022 12:02 PM, Justin Taylor wrote:
We had a long-time dev retire, and I'd like to change ownership on all
the
objects he owns. Typically when a user leaves we just have the DLTUSRPRF
change ownership, but in this case we're not ready to delete the user.

Is there a way to do a mass owner change without deleting the profile?


TIA

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

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.