Original Software and Midrange Dynamics

BASINGSTOKE, UK and Zug, Switzerland – Sept 30th, 2021

Original Software, a leading provider of testing and test management software, announced today that it has partnered with Midrange Dynamics to deliver world class, reliable change management and testing software for IBM i businesses worldwide.

Through this partnership, Original Software and Midrange Dynamics can now provide a full suite of change management and testing solutions to IBM i businesses. Testing solutions include Test Data Management, Batch Program Testing, Test Automation and Regression Testing.

“We are pleased to partner with Midrange Dynamics to provide our testing solutions for businesses with IBM i,’ said Colin Armitage, CEO of Original Software. “There are thousands of businesses that depend and rely on IBM i technology every day and finding the right tools to support this is important. Original Software is the only company that can provide a comprehensive set of testing tools for IBM i platforms. Midrange Dynamics has proven expertise delivering Change Management Solutions, consultancy and technical support for IBM i businesses worldwide.”

“The collaboration with Original Software, and seamless integration of their industry-leading testing tools with the Midrange Dynamics solutions, makes it easy for organizations to include automated testing in their CI/CD process,” said Michael Morgan, Midrange Dynamics Managing Director.  “As a trusted consultant, our goal is to recommend the best possible solutions to our clients. We are excited about the value our partnership with Original Software will deliver to our shared customer base,” said Mr. Morgan.

About Original Software

Original Software enables organizations to meet their testing objectives rapidly, by delivering innovative solutions to support application quality. For over 25 years, their mission has been to deliver quality software, that is easy to buy, has an intuitive UI and is loved by their clients. Original Software has always offered capabilities for the IBM i that went deeper than any other platform and addressed the particular demands of this server and its operating system. Visit https://origsoft.com/ to find out more or to https://i400quality.com/ for our IBM i testing solutions.

About Midrange Dynamics

Midrange Dynamics provides application lifecycle and API management for hundreds of enterprises and small IT teams worldwide. An IBM Business Partner and IBM ISV council member, the company has been advancing MDCMS for 23 years from its headquarters in Switzerland to meet change management requirements with intuitive, simple-to-use solutions for IBM i and multiplatform development. Whether an organization is on the forefront of DevOps practices, heavy into SQL, or mixing old and new methodologies, Midrange Dynamics can help.

Midrange Dynamics partners with companies around the globe to sell and support the MDCMS product suite. Visit https://www.midrangedynamics.com/where-to-buy to find a representative in your region.

DB2 for i SQL JSON Essential Cheat Sheet

Last Updated on 9 October 2021 by Roberto De Pedrini

Whenever I have to create a JSON to call a Web Service or exchange data with other applications, I have to open previous programs and do a great job of copying and pasting … I thought that creating a small source with the main things could help me … and why not create a Cheat-Sheet to share the IBM i Community?

So here’s a post and a Cheat-Sheet “DB2 for i SQL JSON_OBJECT essential cheat sheet” dedicated to JSON_OBJECT: you can download it, print it, and hang it on the wall behind your PC or at the coffee dispenser.

The official IBM documentation about JSON generation with SQL is available at the following link “ Generating JSON Data

Contributions from readers are welcome so as to enrich the collection with your examples … use the comments to add your contributions, I will edit the post to add examples, tricks, etc.

JSON_OBJECT – Creating a JSON from the DB or from variables and strings

The JSON_OBJECT scalar function allows the creation of JSON starting from the data of a table or view, from variables, or from strings and numbers.

Example 1 – Simple JSON from strings

— Simple JSON

select json_object(‘id’ value 1,
‘Brand’ value ‘Apple’,
‘Model’ value ‘Iphone 12 Pro’,
‘Price’ value 1069.00)
from sysibm.sysdummy1
;

–> Result
{
“id”: 1,
“Brand”: “Apple”,
“Model”: “Iphone 12 Pro”,
“Price”: 1069.0
}

— Or, in a tableless way, for the same result

values(json_object(‘id’ value 1,
‘Brand’ value ‘Apple’,
‘Model’ value ‘Iphone 12 Pro’,
‘Price’ value 1069.00));

Example 2 – Simple JSON from a table (QIWS / QCUSTCDT is an example table we all have on IBM i)

— Simple JSON from a Table
select json_object(‘CustomerId’ value cusnum,
‘LastName’ value lstnam,
‘Credit Limit’ value CDTLMT)
from qiws.qcustcdt
where state=’NY’;

–> Result … 3 json objects
{“CustomerId”:839283,”LastName”:”Jones “,”Credit Limit”:400}
{“CustomerId”:397267,”LastName”:”Tyron “,”Credit Limit”:1000}
{“CustomerId”:192837,”LastName”:”Lee “,”Credit Limit”:700}

Example 3 – Get a single JSON with multiple objects “inside”

select json_object(‘Credits’ value json_arrayagg(json_object(‘CustomerId’ value cusnum,
‘LastName’ value lstnam,
‘Credit Limit’ value CDTLMT) ))
from qiws.qcustcdt
where state=’NY’;

–> Result
{
“Credits”: [
{
“CustomerId”: 839283,
“LastName”: “Jones “,
“Credit Limit”: 400
},
{
“CustomerId”: 397267,
“LastName”: “Tyron “,
“Credit Limit”: 1000
},
{
“CustomerId”: 192837,
“LastName”: “Lee “,
“Credit Limit”: 700
}
]
}

Example 4 – JSON inside a JSON

select json_object(‘Credits’ value json_arrayagg(json_object(‘CustomerId’ value cusnum,
‘Details’ value json_object(
‘LastName’ value lstnam,
‘Initials’ value INIT,
‘Street’ value street,
‘City’ value city),
‘Credit Limit’ value CDTLMT)))
from qiws.qcustcdt
where state=’NY’;

–> Result
{
“Credits”: [
{
“CustomerId”: 839283,
“Details”: {
“LastName”: “Jones “,
“Initials”: “B D”,
“Street”: “21B NW 135 St”,
“City”: “Clay “
},
“Credit Limit”: 400
},
{
“CustomerId”: 397267,
“Details”: {
“LastName”: “Tyron “,
“Initials”: “W E”,
“Street”: “13 Myrtle Dr “,
“City”: “Hector”
},
“Credit Limit”: 1000
},
{
“CustomerId”: 192837,
“Details”: {
“LastName”: “Lee “,
“Initials”: “F L”,
“Street”: “5963 Oak St “,
“City”: “Hector”
},
“Credit Limit”: 700
}
]
}

Example 5 – Layered JSON using SQL’s Group By and JSON_ARRAYAGG functions

The group by function, together with JSON_ARRAYAGG will allow you to create arrays of JSON objects inside a JSON:

select json_object(‘state’ value state,
‘Count’ value count(*),
‘Details’ value json_arrayagg(json_object(‘CustomerId’ value cusnum,
‘LastName’ value lstnam,
‘Credit Limit’ value CDTLMT)
))
from qiws.qcustcdt
group by state
order by state;

–> Result
{“state”:”CA”,”Count”:1,”Details”:[{“CustomerId”:475938,”LastName”:”Doe “,”Credit Limit”:700}]}
..
{“state”:”NY”,”Count”:3,”Details”:[{“CustomerId”:839283,”LastName”:”Jones “,”Credit Limit”:400},{“CustomerId”:397267,”LastName”:”Tyron “,”Credit Limit”:1000},{“CustomerId”:192837,”LastName”:”Lee “,”Credit Limit”:700}]}
{“state”:”TX”,”Count”:2,”Details”:[{“CustomerId”:938472,”LastName”:”Henning “,”Credit Limit”:5000},{“CustomerId”:593029,”LastName”:”Williams”,”Credit Limit”:200}]}
..

Example 6: NULL management

— For the null value … I will use a Null Global variable

create variable faq400.GV_NULL char(1) default Null;

values(json_object(‘id’ value 1,
‘Brand’ value ‘Apple’,
‘Model’ value ‘Iphone 12 Pro’,
‘Price’ value faq400.gv_Null
));

–> Result (with the key price with a null value
{
“id”: 1,
“Brand”: “Apple”,
“Model”: “Iphone 12 Pro”,
“Price”: null
}

— If we ad the ABSENT on NULL clause
values(json_object(‘id’ value 1,
‘Brand’ value ‘Apple’,
‘Model’ value ‘Iphone 12 Pro’,
‘Price’ value faq400.gv_Null
Absent on null
));

–> Result
{
“id”: 1,
“Brand”: “Apple”,
“Model”: “Iphone 12 Pro”
}

— Another way to insert a null value
values(json_object(‘id’ value 1,
‘Brand’ value ‘Apple’,
‘Model’ value ‘Iphone 12 Pro’,
‘Price’ value cast(NULL as varchar(10))
));

— Another one
values(json_object(‘id’ value 1,
‘Brand’ value ‘Apple’,
‘Model’ value ‘Iphone 12 Pro’,
‘Price’ value ‘null’ format JSON
Null on null
));

Example No. 7 – Create a JSON document in the IFS

I talked about it in another post on this blog: “ DB2 for i & SQL – FAQ & Howto (Part.2) (IT) “, to the Faq” iDB2-FAQ-016 – How to store a CLOB in your IFS “… in this piece of ILE RPG code we see the use of a CLOB_FILE variable to store the result in an IFS file.


DCL-S OutFile SQLType(CLOB_FILE) CCSID(1208);

select json_object(‘Credits’ value json_arrayagg(json_object(
‘CustomerId’ value cusnum,
‘LastName’ value lstnam,
‘Credit Limit’ value CDTLMT) ))
into :OutFile
from qiws.qcustcdt
where state=’NY’;

Outfile_Name = ‘/temp/accounts.json’
Outfile_NL = %len(%trimr(Outfile_Name))
Outfile_FO = SQFCRT;

Example No. 8 – Boolean values TRUE and FALSE in JSON

Boolean values (true) and (false) are written in JSON objects without the quotes (“) and always in lowercase … to distinguish them from alphanumeric values.

To obtain the value true and false we must use the non-specific “format JSON”, to indicate that the value of the last JSON is already a JSON!

— These are Boolean
{“Boolean01”:true}
{“Boolean02”:false}

— This is non a Boolean but a Alpha-Key
{“ThisIsNotABooleanKey”:”true”}
{“ThisIsNotABooleanKey”:TRUE}

— Dealing with boolean in DB2 for i SQL and JSON_OBJECT
select json_object(‘Customers’ value json_arrayagg(json_object(‘CustomerId’ value cusnum,
‘LastName’ value lstnam,
‘Is a creditor’ value case when cdtdue>0 then ‘true’ else ‘false’ end format JSON)))
from qiws.qcustcdt
where state=’NY’;

–> Result
{
“Customers”: [
{
“CustomerId”: 839283,
“LastName”: “Jones “,
“Is a creditor”: false
},
{
“CustomerId”: 397267,
“LastName”: “Tyron “,
“Is a creditor”: false
},
{
“CustomerId”: 192837,
“LastName”: “Lee “,
“Is a creditor”: true
}
]
}

Example No. 9 – Creation of an HTTP Header for the QSYS2.HTTP functions

I talked about the QSYS2.HTTP functions to consume Web Service via SQL in the post “ New QSYS2.HTTP Functions SQL (7.4 TR5 and 7.3 TR11) “, I report below a part of RPG code where I use QSYS2.HTTP_POST to call web services of a payment system. Use of variables for URL, Header, Body, and Response to be able to log the call in a log table

..
dcl-s HttpHeader varchar(1024);
dcl-s Body varchar(10000);
dcl-s Url varchar(256);
dcl-s ResponseHeader varchar(1024);
dcl-s Responsemsg varchar(10000);

url=’xx’;
exec sql
set :body=Json_object(….)

exec sql
set :HTTPheader=
json_object(‘header’ value ‘content-type,application/json’,
‘header’ value ‘content-length,’ concat length(trim(:BODY)),
‘sslTolerate’ value ‘true’);

// HTTP_POST
exec sql
select response_http_header, response_message
into :responseheader :Null_ds,
:responsemsg :Null_ds
from table(QSYS2.HTTP_POST_VERBOSE(:url,
cast (:body as clob(10M)),
cast (:HttpHeader as clob(3k)) ));

Example No. 10 – Json Object, Array and Array-Aggregate

select json_object(‘MyCompany’ value json_arrayagg(json_object(‘id’ value a.empno,
‘Employee’ value json_object(‘First Name’ value a.FirstNme,
‘Last Name’ value a.Lastname,
‘BirthDate’ value a.Birthdate),
‘paycheck’ value json_array(json_object(‘Type’ value ‘Salary’,
‘Amount’ value a.Salary),
json_object(‘Type’ value ‘Bonus’,
‘Amount’ value a.Bonus),
json_object(‘Type’ value ‘Comm’,
‘Amount’ value a.Comm)),
‘workdept’ value workdept,
‘Collegues’ value json_array( select trim(b.lastname) concat ‘ ‘ concat trim(b.FirstNme)
from sampledb.employee b
where b.workdept=a.workdept
and b.empno<>a.empno))))
from sampledb.employee a;

–> Result
{
“MyCompany”: [
{
“id”: “000010”,
“Employee”: {
“First Name”: “CHRISTINE “,
“Last Name”: “HAAS “,
“BirthDate”: “1933-08-24”
},
“paycheck”: [
{
“Type”: “Salary”,
“Amount”: 52750.0
},
{
“Type”: “Bonus”,
“Amount”: 1300.0
},
{
“Type”: “Comm”,
“Amount”: 4220.0
}
],
“workdept”: “A00”,
“Collegues”: [
“HAAS CHRISTINE”,
“LUCCHESSI VINCENZO”,
“O’CONNELL SEAN”,
“HEMMINGER DIAN”,
“ORLANDO GREG”
]
},


Roberto De Pedrini
Faq400.com

Confident about your next ERP upgrade?

Confident about your next ERP upgrade?

Or does the thought of it give you sleepless nights.

Are you confident about updating your business applications?

I don’t blame you.

You are not alone.

Most businesses are reluctant to update their core applications, such as ERP and CRM systems, so struggle to respond and move forward with their business initiatives.

Issues we regularly encounter include:

Slow User Acceptance Testing (UAT) preventing releasesLimited testing resourcesLack of visibility on issues, bugs, and defects before go-live

Are any of these familiar to you? If so, we can help you.

Full end-to-end testing

Original Software helps businesses update their enterprise applications faster and with more confidence. We are the only company that can provide full end-to-end testing before go-live, helping our customers release better, faster, and more affordably.

Enjoy weekly updates with zero defects reaching production

One of our customers, CertainTeed, update their systems weekly with zero defects reaching production and hundreds of man-hours saved. Read more:

Or have a no-obligation informal consultation with one of our trusted advisers.

The post Confident about your next ERP upgrade? appeared first on Original Software.

Come watch what IBM Systems Lab Services leaders have to say about what you can expect from the #IBMTechU 2021 virtual edition. Register here ➡️ ??Ⓜ️ #IBMStorage #InnovationLeader #IBMtechnology #IBMStorageRocks?

Come watch what IBM Systems Lab Services leaders have to say about what you can expect from the #IBMTechU 2021 virtual edition. Register here ➡️ ibm.biz/virtualtechu20… ??Ⓜ️ #IBMStorage #InnovationLeader #IBMtechnology #IBMStorageRocks? bit.ly/3uWlQZd

– Thilo Dotzel ? (Mr. Storage ?? 😉 (@thilodotzel)02:16 – Oct 09, 2021

Library List Settings – Your PDM Can Not Do That

Dealing with missing Libraries for copy or include source can be a hassle. In today’s video, I’ll show you how to use the Object Table view “Subset” feature to quickly find the object and add it using the new Library List view, and how to set a library to the library list so it’s already there the next time you restart #RDi! I’ll also show you how to restore and minimize the Object Table view so you have more source and Outline view, all in under 90 seconds! #YourPDMCanNotDoThat!
Verified by MonsterInsights