As I See It: The Forgotten Ones Doug Bidwell

​[[{“value”:”It was the old black-and-white photo that first captured my attention: A woman standing next to a stack of thick folders containing green-bar printer paper that stretched from the floor to just above her head. In the photo she is smiling and appears to be balancing the unsteady tower. The year is 1969, the woman is Margaret Hamilton, and she has good reason to smile.
Eight years prior, she worked at the MIT Lincoln Lab, a research and development facility funded by the Department of Defense. There, she worked on something called the Semi-Automatic Ground Environment (SAGE) Project. MIT was …
The post As I See It: The Forgotten Ones appeared first on IT Jungle.”}]] Read More 

IBM i PTF Guide, Volume 27, Numbers 3 And 4 Doug Bidwell

​[[{“value”:”We are finally getting back into synch between The Four Hundred and the IBM i PTF Guide, and with this week’s issue numbers 3 and 4, you will be all caught up.
In Number 3, dated January 18, we note that IBM has put out the latest service pack 950.D0 for system firmware levels VL950, VM950, and VH950, which you can read all about here. The updates are available for the following Power9 machines:

Power System S914 (9009-41G)
Power System E950 (9040-MR9)
Power System E980 (9080-M9S)
Power System H922 (9223-22H)
Power System H922 (9223-22S)
Power System H924 (9223-42H)


The post IBM i PTF Guide, Volume 27, Numbers 3 And 4 appeared first on IT Jungle.”}]] Read More 

Talsco Weekly: Altcoins Positioned for 2025 Success patrick staudacher

​[[{“value”:”Welcome to another edition of Talsco Weekly IBM i Brief:  🔮 ​IBM i pros share bold predictions for 2025​. AI:  ​IBM’s Code Assist for RPG making steady progress​. Other AI News. Development:  💻 ​IBM’s RPG Code Assist aims for mid-2025 launch​. 💻 ​Simplify Your RPG Source Control with Git – A 10-Minute Guide​. Database:  📊
The post Talsco Weekly: Altcoins Positioned for 2025 Success appeared first on IBM i (AS/400, RPG) Recruiting, Staffing & Consulting.”}]] Read More 

QTEMP Performance Loses Again [email protected] (Kent Milligan – IBM Technology Expert Labs)

​[[{“value”:”In the past, I’ve written about
the inefficiencies caused by referencing QTEMP tables in your query requests. Due to
the performance overhead of this approach, our IBM Expert Labs team is often
employed by clients to help them reduce the number of queries using QTEMP. 
While
working with a customer recently, I was reminded of one reason where developers
in the past were forced to use QTEMP queries with stored procedures. While Db2
for i has supported stored procedures which return result sets for a very long
time, there were many releases where those result sets were not available to
invokers using embedded SQL. If the invoking program wanted to consume a result
set returned by a stored procedure, the program had to use an API-based
interface like the SQL Call Level Interface (CLI) or JDBC.  So, if you were an RPG or COBOL programmer
you could use embedded SQL to call a stored procedure, but you were out of luck
when it came to using embedded SQL to consuming the contents of a result set
returned by a stored procedure.
 
This
limitation was what drove some developers to use QTEMP queries. The basic idea
is that if the stored procedure copied the contents of its result set into a
QTEMP table, then the invoker of the stored procedure just needed to know the
name of the QTEMP table in order to be able to consume the result set with a
simple query.
 
Here’s
an example of a logic from a stored procedure using the QTEMP technique to
return a result set to the invoker.
…– Create QTEMP result set table if it doesn’t exist in job yet
DECLARE CONTINUE HANDLER FOR SQLSTATE ‘42704’
CREATE TABLE qtemp.results
AS (SELECT ordID, ordCustID FROM orders
WHERE ordDate = inputDate) WITH NO DATA;

— Clear our result set rows from prior call
DELETE FROM qtemp.results;

— Populate with result set rows
INSERT INTO qtemp.results
(SELECT ordID, ordCustID FROM orders WHERE ordDate = inputDate);

 
 
The
invoker would then declare a cursor over the QTEMP table to consume the result
set with this simple query: SELECT ordID, ordCustID FROM qtemp.results. This
query is one reason that the QTEMP solution has slower performance. The
application needs to one run query to populate the QTEMP table and a second
query to unload the QTEMP table.
 
The
good news is that there’s a simpler and faster solution which has been
available since the IBM i 7.1 release. This solution is made possible through
Db2’s support for result set locator variables. Think of result set locator
variables like pointers. These result set locators enable the stored procedure
invoker to simply point at the result set returned by the procedure in order to
consume it. This approach is more efficient since it doesn’t require a copy of
the result set to be made like the QTEMP approach.
 
Using
the result set locators support, a stored procedure uses an SQL cursor to make
the result set contents available to the invoker. The following SQL
demonstrates how that is done.
CREATE PROCEDURE GetOrders()
LANGUAGE SQL
DYNAMIC RESULT SETS 1
BEGIN

DECLARE ordCursor CURSOR WITH RETURN FOR
(SELECT ordID, ordCustID FROM orders
WHERE ordDate = inputDate);

OPEN ordCursor;

END

 
The
consumption of this stored procedure’s result set is enabled by result set
locators as shown in the following snippet of SQL code.
DECLARE rs1 DECLARERESULT_SET_LOCATOR VARYING;

ASSOCIATE LOCATOR(rs1) WITH PROCEDURE GetOrders;

ALLOCATE rs1Cursor CURSOR FOR RESULT SET rs1;

FETCH rs1Cursor INTO ordIdVar, custIdVar;

 
After
declaring variable rs1 as a result set locator, the first step is executing the
ASSOCIATE LOCATOR statement to point the rs1 variable at the result set
returned by the GetOrders stored procedure. 
The ALLOCATE CURSOR statement is the final step that needs to be
performed since a cursor is required to retrieve the rows contained in the
result set. In this example, the a cursor named rs1Cursor is allocated to fetch
the rows from the stored procedure result.

Now
that the two different coding methodologies have been compared, let’s talk
about performance. In my testing, I measured the performance of repeated calls
to the stored procedure in a single job. With distributed applications, it’s
very common for the same stored procedure to be called over and over again
within a database connection or job. My performance tests showed the
QTEMP-based solution to be 2-4.5x slower than the solution using result
set locators.  The result set locator
performance advantage grew as the number of stored procedure calls increased.
When comparing the performance of 25 calls, the result set locator solution was
2x faster. The performance advantage of result set locators grew to 3.8x faster
with 150 procedure calls and to 4.5x faster with 300 procedure calls.
 
In my
performance tests, the stored procedure result set contained 25 rows. Thus,
each call to the QTEMP-based stored procedure results in 25 rows being copied
into the QTEMP table. The QTEMP solution performance would slow even further
with result sets that are larger in size. In addition, if the stored procedures
were being called in multiple jobs, the QTEMP solution would suffer from the
Plan Cache inefficiencies that I highlighted in my original QTEMP article.
 
There are some cases
where a QTEMP-based solution is the winning choice, but hopefully it’s now clear
that using a QTEMP table to return a stored procedure result set is clearly not
one of those situations.”}]] Read More 

Database and Security Journaling on the IBM i Doug Demagistris

​[[{“value”:”Remote journaling allows organization s to export journal entries to other IBM i systems where they can be used in a number of disaster recovery, high availability, and system restor ation solutions offered by IBM and other vendors.
Security journaling allows organizations to export IBM i log and activity information to Security Information and Event Management (SIEM) systems for enterprise-wide security analysis.”}]] Read More 

Verified by MonsterInsights