-
Guru: Parsing JSON That Has Spaces In The Key
July 8, 2024 Mike Larsen
One of my favorite tasks is working with APIs. I’ve worked with many APIs over the years, and some introduce unique challenges that must be overcome. Recently, I worked on a project where I was to consume a REST API that provided a JSON payload. While that seems straight forward, I quickly discovered a challenge.
The JSON payload had keys that have spaces in them (Figure 1). That may be considered bad practice, but I still needed to figure out how I could parse it correctly. Having never seen JSON like this before, I started with a Google search. I …
Read more -
Guru: Partitioning Result Sets Using SQL
November 27, 2023 Mike Larsen
While working on a project recently, I needed to retrieve attributes of an item. While that sounds like a simple task, there was a twist. While reviewing the contents of the item master table, I noticed there could be multiple rows for the same item and each row was active and valid from a business perspective.
I won’t get into the business end of it, but my goal was to return the most recent iteration of the item for further processing in the program. After doing some research and trying some potential solutions, I came across the SQL partition by …
Read more -
Guru: Comparing IFS Directories Using SQL
June 19, 2023 Mike Larsen
I use SQL almost every day at my job. It may be just a query in ACS, or it may be embedded SQL in an RPG program. A few days ago, I needed to compare the contents of one IFS directory to another. Combining a few different table functions, I was able to develop a nice solution.
Note: The code for this article can be downloaded here.
In this example, I have a directory that has five text files in it. I have a second directory that has three text files in it, and they are the same documents …
Read more -
2022: An IBM i Year In Review: Part 2
December 19, 2022 Alex Woodie
In part one of this now annual recap of the IBM i world that we do here at IT Jungle, we reminisced on the biggest stories of the first six months of the year. There was quite a bit going on, with the launch of IBM i 7.5 and more. But getting into the last half of the year – now that’s where the real action began.
July
The first full month of summer started off with a bang when IBM, after much anticipation, unveiled the long-awaited scale-out Power10 machines. The Power10 rollout included the S1014, with …
Read more -
Guru: String Manipulation Using SQL
October 24, 2022 Mike Larsen
Recently, I was working with an employee file where first and last name were concatenated with a comma separator. A requirement of the project was to parse the name and populate a different table where first and last name are separate columns. I won’t address the design of the employee file, but I will show how I completed the request.
In Figure 1, I use the position string function via SQL to extract the first name.
Figure 1. Extract first name
In this example, I use the trim, substring, and posstr functions to position to the first …
Read more -
Guru: Regular Expressions, Part 1
July 25, 2022 Mike Larsen
In the first part of this series, I will show how to replace characters in a string using SQL and regular expressions. I know I can replace characters using RPG or SQL, and they work great, but there are some cases where I find using regular expressions is a bit easier.
For the examples I’ll show, I’m using the REGEXP_REPLACE function. REGEXP_REPLACE allows me to search for a particular value within a string and replace it with another value.
In the first example (Figure 1), I want to search a string that has both letters and digits and I want …
Read more -
Top Five Failures In State of IBM i Security For 2022
April 18, 2022 Alex Woodie
HelpSystems last week officially unveiled its annual State of IBM i Security report, the 18th straight year for the series. Like with past reports, the 2022 version highlights some of the continuing challenges that IBM i customers face when trying to secure their systems. A few key areas stand out above the rest.
The IBM i server is a bit of an enigma when it comes to security. While it is widely perceived to be one of the most secure computing platforms on the planet – and “virus-proof” to boot – the reality is that a good number of IBM …
Read more -
IBM Encourages IAS and IWS Users to Move to Java 8
December 1, 2021 Alex Woodie
IBM is now encouraging IBM i customers to move to Java 8 for their Integrated Web Application Server (IAS) and Integrated Web Services (IWS) environments. While the IAS and IWS environments can still run on older versions of Java, they are not fully supported by IBM, the company announced last month.
IAS is a lightweight Java application server for IBM i that serves as a foundation for developing and running Java Server Pages (JSP) and Java servlet-based applications. It is based on WebSphere Application Server Liberty, the slimmed down and open version of the traditional IBM WebSphere environment. It has …
Read more -
Db2 PTF Group Enhancements Target Web Services, Audit Journal
October 4, 2021 Alex Woodie
It is indisputable that the Db2 for i database is the beating heart of the IBM i platform. There were no earthshattering enhancements to this database in the latest batch of Technology Refreshes for IBM i 7.3 and 7.4 that IBM announced and shipped last month. But there were a few items worth mentioning that shipped in the Db2 PTF Group, including new HTTP commands for calling the database via REST and new SQL-based commands for querying the security audit journal.
The top new Db2 for i feature arguably is the new set of functions for HTTP requests to consume …
Read more -
So You Want To Do Containerized Microservices In the Cloud?
June 30, 2021 Alex Woodie
As a modernization consultant working in IBM’s Rochester, Minnesota, lab, Amy Anderson gets to hear from some of the most tech-savvy IBM i shops in the world. Her job requires her to know where shops are now, listen to where they want to go, and chart a path that takes them there. That can sometimes be quite a challenge, especially considering the rapid pace of technological change at the moment.
“One of the things that we’re seeing now is the whole industry now is focused on modernization,” Anderson said during her session at the recent NAViGATE conference hosted by COMMON …
Read more