I was just looking at an example Simon Hutchinson put on his website
(rpgpgm.com) using SQL.
The problem (if it really is one) is that putting SQL into RPG is a new
level of complexity that, well for those of us that have not kept up, is
somewhat daunting. The actual EXEC statements not hard, but proper error
handling is. I lost my RPG card long ago (Jon and Susan rather
non-ceremonially removed it, with valid reason I might add), and only now
really starting to use it again.
This example is as close as I can get, the work management items you cite do
not report the library list:
-- category: IBM i Services
-- description: Librarian - Library list
--
-- Description: Ensure that the TOYSTORE library is the first library
-- in the user portion of the library list
BEGIN
DECLARE V_ROW_NUM INTEGER;
WITH CTE1(SCHEMA_NAME, ROW_NUM) AS (
SELECT SCHEMA_NAME, ROW_NUMBER() OVER (ORDER BY ORDINAL_POSITION) AS
ROW_NUM
FROM QSYS2.LIBRARY_LIST_INFO WHERE TYPE = 'USER'
) SELECT ROW_NUM INTO V_ROW_NUM FROM CTE1 WHERE SCHEMA_NAME = 'TOYSTORE';
IF (V_ROW_NUM IS NULL) THEN
CALL QSYS2.QCMDEXC('ADDLIBLE TOYSTORE');
ELSEIF (V_ROW_NUM > 1) THEN
BEGIN
CALL QSYS2.QCMDEXC('RMVLIBLE TOYSTORE');
CALL QSYS2.QCMDEXC('ADDLIBLE TOYSTORE');
END;
END IF;
END;
Now to code this into an RPG program with valid error handling. That will
be somewhat more challenging.
--
Jim Oberholtzer
Agile Technology Architects
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Rob
Berendt
Sent: Monday, August 30, 2021 9:34 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Finding QUSRJOBI information on IBM's web site.
If you start out here:
https://www.ibm.com/docs/en/i/7.4
And enter QUSRJOBI in the box with "Search in IBM i 7.4" you should get
exactly to what you want.
Now for my Rob moment...
IBM's hiding of "IBM i Services" under "Performance and Query Optimization"
may have been a good idea at some time in the past, but really?
And why not use one of these instead of QUSRJOBI?
https://www.ibm.com/docs/en/i/7.4?topic=services-work-management
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail
to: 7310 Innovation Blvd, Suite 104
Ft. Wayne, IN 46818
Ship to: 7310 Innovation Blvd, Dock 9C
Ft. Wayne, IN 46818
http://www.dekko.com
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
midrangel@xxxxxxxxxxxxxxxxx
Sent: Monday, August 30, 2021 10:26 AM
To: 'Midrange Systems Technical Discussion' <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Finding QUSRJOBI information on IBM's web site.
CAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know the
content is safe.
It's there no doubt, but how come IBM has to give it to me in every language
except US English? My browser does not hide the fact that I am in the
Midwest in the US, (not all that far from Rochester MN.) so it's not like
they don't know where I am. IBMs web sites are a mess, most links don't
work, they don't fix them when you point that out, and the search in them is
worse than ever. Makes me long for the PC based software library. It was
awful and not updated very often, but it worked. Particularly for an API
that's been around since almost before API's...
Anyone else having similar issues?
--
Jim Oberholtzer
Agile Technology Architects
--
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.