Talsco Weekly: How IBM i leadership strikes a balance between operation and innovation

Welcome to another edition of Talsco Weekly

News:  Economy and the IBM i.  The Perfect Storm.
Blockchain:  Blockchain offers interoperability for the enterprise.
Leadership:  How IBM i leadership strikes a balance between operation and innovation.
Open Source:  Vue vs React: Everything You Need To Know.
Security:  What is going on with IBM i Security?

News

The Perfect Storm

We don’t cover economic news, and for good reason, it seems to be a moving target.

But, what we can comment on, is the economic indicators that we see and how they relate to the IBM i community.

As a firm specializing in the IBM i space, we continue to see continued growth in the direct hire and consulting services we provide.

We are specialized.

We only focus on organizations that are looking to leverage, modernize and extend the reach of the IBM i platform.

Succession Planning & Modernization: The Perfect Storm.

Regardless of economic conditions, there is a need for IBM i talent, the need to modernize, and the need to extend the reach of the IBM i platform.

It’s the perfect storm.  A catalyst for change and innovation.

It is leading the IBM i community to adapt and think differently.

The IBM i experts that are retiring, need to be replaced.  But, the skills set for the future will be a little different.

For most IBM i shops, the need to modernize and innovate, will call for an IBM i Developer that can use a variety of tools.  While some of the tools are old, some are new (think open-source).

Whatever those the tools are, the Technology Refreshes are there to support the changes.

Bottom line, the IBM i platform is here to stay.  And if used to its potential, it will help organizations prosper, in any economy.

Blockchain

Blockchain offers interoperability for the enterprise

There are a number of market forces that are having an impact on the IBM i community.  Retirements and the lack of RPG resources are pushing IT leaders to take a look at the things they need to do to attract talent.

At the same time, these organizations are being asked to modernize their core applications as well as extend the reach of business systems outside native IBM i applications, that is make them interoperable with the outside world.

One way to do this is through the use of APIs. This is the process of pushing and pulling data in and out of the organization, making it more accessible.

Blockchain is one of the ways to make your enterprise systems interoperable. While the individual technology pieces are not necessarily new, the way it is all put together is, and it is starting to make its way into the enterprise.

What is blockchain?

“A blockchain is a digital ledger that records transactions in a secure, decentralized, and transparent way. It uses cryptography to ensure the integrity and immutability of the data, and its distributed nature eliminates the need for intermediaries, making it a trusted and efficient way to transfer value or information.”

One blockchain that looks promising for the enterprise is Chainlink.

What is Chainlink?

“Chainlink is the only enterprise-grade oracle infrastructure that enables organizations to securely and easily connect their existing systems to all major blockchain networks.”

Yes, I know, this brings about a number of other questions, like what are blockchain networks and what is an oracle network?

If you are at all curious, here are a number of use-cases on now blockchain, and in this case, Chainlink, can be used in the enterprise.

Leadership

How IBM i Leadership strikes a balance between operation and innovation

“CIOs are often teetering between striving for innovation and maintaining operational excellence.”

Innovation helps optimize

“A long-running theme with respect to IT budgets and other resources is that innovation, which can deliver new services and better experiences to customers, is engaged in a continual tug-of-war with operations”

But, innovation should also be a way of optimizing.

Innovation, by its nature, is a way of looking at things differently.

It should be “viewed as a force for simplifying and optimizing operations.” And “striking the right balance between innovation and operations is essential for any organization to succeed and stay competitive.”

The three golden rules of innovation

To get the right balance, leaders need to focus on the following areas:

Functionality: “Reminds leaders always to remember the mission.”
Serviceability: Reminds leaders always to be serving the users and the business, and never “innovate for innovation’s sake.”
Experience: Leverage your existing experience with automation. This is the short form of innovation. Make things better by simplifying processes.

Key Takeaway:

Stop “ignoring technical debt; instead, prioritize actual application modernization investments that can break the pattern and open up innovation cycles as part of a continuous modernization strategy.”

Open Source

Vue vs React: Everything You Need To Know

“Vue and React are two of the most popular tools for creating JavaScript web applications. But how do we choose between them? That’s what we’ll try to figure out in this Vue vs React comparison. We’ll review the upsides and downsides of each, provide tips for choosing which to use, and help you get started.”

Security

What is going on with IBM i Security?

“Security is a very high concern among IBM i shops – and consistently has polled as the most important concern for the past several years.”

It’s one thing to know security is important, but it’s another to understand the relative occurrence of different types of attacks.

IT Jungle dives into IBM’s “Security X-Force Threat Intelligence Index 2023” report highlighting the top industries that are attacked and how it impacts the business.

For “whoever is responsible for securing your IBM i and other platforms in your IT shop” this is a must-read.

Join

Sign up for Talsco Weekly to get the latest news, insight and job openings for the IBM i professional.

Contact us

If you are an RPG programmer looking to explore opportunities or a client who is looking for a talented IBM i professional, please contact us. We look forward to assisting you.

Share

Do you know of someone who could benefit from Talsco Weekly? If so, please use the social media buttons to spread the word. Thank you!

The post Talsco Weekly: How IBM i leadership strikes a balance between operation and innovation appeared first on IBM i (AS/400, RPG) Recruiting, Staffing & Consulting.

Integrate Python, Node, PHP, etc. with CL & RPG on IBM i – 2023 Update

A few years ago I introduced you to my QShell on i utility – QSHONI. QSHONI makes it easy for traditional CL, RPG, and COBOL programs to call Python utilities and other QShell/PASE utility programs (PHP, Node, Java, etc.) and directly use their output. QSHONI opened up a whole new world of integrations to open source apps from RPG, CL, and COBOL.

In this post I will update you on new features that have been added to the QSHONI utilities over the past 12 months.

As a reminder, if you are still using the PYRUN command to run Python apps, consider migrating to QSHONI’s QSHPYRUN or QSHEXEC commands. PYRUN still works, but it is no longer being maintained.

Write or Append STDOUT to an IFS File

Logging to IFS files has now become easier. The core QSHONI commands—QSHEXEC, QSHBASH and QSHPYRUN—now support a parameter named IFSSTDOUT. The new parameter allows each command to write or append its STDOUT (standard output) to an app-specific, IFS-based log file.

Writing or appending to an app-specific IFS log file can be useful if you want to use print statements in your Python (or other) code to output useful info to STDOUT, and then use that info for logging the success or failure of your Python or other language scripts. IFS log files can be visually reviewed or read by log readers and other tools to review success or failure events. This option adds maximum flexibility for STDOUT logging.

Python Virtual Environments

The QSHPYRUN command now supports Python virtual environments for running Python apps that belong to a virtual environment. Simply set the “use virtual environment” parameter to *YES and then specify the “virtual environment base path” directory parameter, and your Python app will be called using the selected Python virtual environment.

Easily Pass Parameters to curl

Curl is the popular open source program for sending and receiving content from APIs and many other sources, internal and external. For developers who want to call curl conveniently, QSHCURL is essentially a front end over the QSHEXEC command that allows an RPG or CL developer to easily call the PASE curl command with parameters. As soon as curl finishes its processing, the program output can be utilized directly from a classic CL/RPG program by reading the output file (outfile) contents from file STDOUTQSH in library QTEMP or by consuming any IFS output files that were created for logging.

A good example use case for calling QSHCURL might be to place a call to an external web service and then consume the HTML, XML or JSON result data that gets returned from the QSHCURL call.  This can provide much more flexibility than using the db2 HTTPCLOB functionality to make rest API calls. Curl is like a swiss army knife of connectivity so it’s great to be able to use it from classic CL/RPG apps.

New CL Commands

QSHQRYTEMP

This CL command is a nice convenience wrapper for running SQL queries via RUNSQL and placing the results into a temporary or already existing output table in QTEMP or another library. Once a query completes, the command outputs the resulting records to the specified table. A set of data areas is also created in library QTEMP with result counts to denote how many records were returned.

A good example use case might be to call one of the Db2 services and aggregate the results into an output file for further processing.

QSHPORTCHK

Along with QSHPORTEND, this CL command helps manage and automate web servers and other TCP/IP services. QSHPORTCHK can check for an active TCP/IP service running on a specified IBM i port and IP address. You might have web apps and services that you’ve created and you don’t have a specific shutdown process for the app running on the port. Or maybe you just want to create a periodic service monitor job to see if your TCP services are up and running.  This command will fulfill the need for quick TCP service checks.

A good example use-case might be when you need to monitor a couple web apps or services. The first service could be a Python, PHP or Node application running on a port associated with localhost/127.0.0.1 such as 5001. And perhaps NGINX or Apache is set up as a public web server service on port 443. Two calls to the QSHPORTCHK command can easily tell you if both of your services are up and running.

QSHPORTEND

This CL command is a companion to the QSHPORTCHK command. QSHPORTEND can be used to actually end any jobs that are associated with the selected TCP port.  Both QSHPORTCHK and QSHPORTEND utilize the QSYS2.NETSTAT_JOB_INFO Db2 service to gather information on jobs that are running on the specified port. QSHPORTEND also uses the QSHQRYTMP command internally to write the results of its job search to a temporary file so the QSHPORTEND CL program can process the results.

Using our port check example above, you could first use QSHPORTCHK to check for an active TCP port and then use QSHPORTEND to end all associated jobs running on that TCP port. Think of QSHPORTEND as doing a mass ENDJOB command for all jobs running on the selected TCP port.

QSHSETPROF

This command will save time for system administrators who need to set up PASE users with Bash profiles. QSHSETPROF sets up a user’s default .profile, .bash_profile and .bashrc (Qshell/PASE/bash) profile files from templates stored in source file QSHONI/SOURCE. The default templates will set up a path to the IBM-supplied open source packages located in dir: /QOpenSys/pkgs/bin. The profile template source member names are QSHPROFILE for .profile, QSHBASHPRF for .bash_profile, and QSHBASHRC for .bashrc. When you run the QSHSETPROF command and select a user profile, the command process will first attempt to create a home directory (Ex: /home/USERID) if it doesn’t already exist for the specific user profile. Then it will copy the 3 source members to create .profile, .bash_profile and .bashrsc. Once the profiles are set up, paths should be automatically set if the user runs Qshell/PASE commands via QSH or bash commands from an SSH terminal.

Make sure to visit the QShell on i GitHub site to stay up to date on QSHONI enhancements.

Create SQL Views to interpret QSYS2.DISPLAY_JOURNAL

Last Updated on 10 March 2023 by Roberto De Pedrini

The sources (SQL statement) of this post are available on Github at this link: https://github.com/Faq400Git/Create_Display_Journal_Table_View

Personally I am a big fan of IBM i Services, that series of SQL Functions (UDF and UDTF) and Stored Procedures which, with each Technology Refresh, is enriched in number and functionality.

The QSYS2.DISPLAY_JOURNAL is a UDTF now present since 7.1 of the operating system, and is an excellent alternative to the DSPJRN command to query the journal receiver entries.

Querying Journal events has never been so simple: a SQL statement is able to extract from a Journal (or rather from the Journal Receivers of a Journal) all the events concerning one or more tables under control.

As long as it is a question of querying information about the event on the table (for example event type (insert/delete/update..), event date/time, user, job etc) QSYS2.DISPLAY_JOURNAL is really great, but if we need interpreting the contents of the ENTRY_DATA field (the Blob field with the image of the record) is not exactly that immediate.

Googling here and there I found several ways to read/interpret the contents of this ENTRY_DATA field:

The official IBM site recommends using the SQL INTEPRET function, mapping the fields of interest to the ENTRY_DATA Blob : IBM Support – How to extract and search for ENTRY_DATA in DISPLAY_JOURNAL table function : excellent, INTERPRET allows us to extract our information from that BLOB field, whether they are in CHAR, VARCHAR, DECIMAL, NUMERIC fields, etc. The problem is to retrieve the “offsets” and “lengths” of each field and set the INTERPRET statement accordingly
The great Simon Hutchinson, in his mail “Extracting data from journals using SQL” Instead, he explains how to do it from RPG, reading the DISPLAY_JOURNAL records and mapping the ENTRY_DATA field in a DS with the same structure as our table.
Or fall back to the good old QjoRetrieveJournalEntries API: “ Retrieve Journal Entries (QjoRetrieveJournalEntries) API
Even this technique proposed by Sam Lennon could be an alternative: “ Journal Entries Exposed! JOESD Made Readable !

Despite my searches on Google I have never found anyone who allows me to read and interpret the Journal Entries directly with SQL without going crazy in mapping field to field according to the table of my interest.

So here’s the idea: create a SQL Stored Procedure that reads the names, types, lengths and offsets of the fields from the SYSCOLUMNS catalog and automatically creates a SQL View on the QSYS2.DISPLAY_JOURNAL table function … in short, something that does the dirty work for me of mapping the entire ENTRY_DATA field according to the table concerned.

Once the Stored Procedure has been created, it will be sufficient to recall it by passing it the following parameters:

Journal library
Table name (System Name or SQL Name)
Journal library
Journal name
Library where you want to create the View
Name of the View
Flag Y/N for any REPLACE of the View
Global Variable (or hsot variable from SQL Embedded) where to return the SQL statement of the CREATE VIEW (optional)

call FAQ400.CREATE_DISPLAY_JOURNAL_TABLE_VIEW(MYTABLE_LIBRARY => ‘FAQ400JOU’, MYTABLE_NAME => ‘MYSAMPLETABLE’, MYJOURNAL_LIBRARY => ‘FAQ400JOU’, MYJOURNAL_NAME => ‘QSQJRN’, MYVIEW_LIBRARY => ‘FAQ400JOU’, MYVIEW_NANDACEREPAMPL2 => ‘V__TABLEMYS ‘Y’, MYCMD => FAQ400.GV_VARCHAR);

And then query the view to see the journal entries for the relevant table:

select * from FAQ400JOU.V_MYSAMPLETABLE_AUDIT;

Getting something similar to these two images

The source of the CREATE_DISPLAY_JOURNAL_TABLE_VIEW stored procedure, and some examples of use, can be found in my Github at this link: https://github.com/Faq400Git/Create_Display_Journal_Table_View

Related Posts

DB2 for i SQL – String Manipulation – POSSTR-LOCATE-LOCATE_IN_STRING (EN)

Introduction Often, in our applications, we need to work with text strings, and DB2 SQL can come in very useful Read more


DB2 for i – FAQ & Howtos (EN)

DB2 Database and SQL … maybe the most important things on IBM i platform: here’s a collection of FAQs, tips Read more


IBM i 7.4 Announcement (En)

Comes directly with the Easter egg this IBM announcement for the news of the IBM i 7.4 version, iNext version Read more


Generated Always Columns (EN)

Introduction “Generated Always Column”: are columns, table fields, filled by DB2 engine: something like columns with a default value but Read more


Roberto De Pedrini
Faq400.com

L’articolo Create SQL Views to interpret QSYS2.DISPLAY_JOURNAL proviene da BlogFaq400.

Verified by MonsterInsights