Sure Scott, I will have a look at it. Thank you for your time and help!
Original Message:
Sent: Mon July 24, 2023 04:17 PM
From: Scott Fagen
Subject: JSON Parser in PL/I
I haven't programmed in PL/I since the early 1980s. I was merely pointing out the existence of the services you asked for and the doc that describes them.
Here is a link to a TechChannel tech tip that talks about how to get a program to use these services: https://techchannel.com/Enterprise/07/2021/json-z-os-program.
Happy parsing,
Scott
------------------------------
Scott Fagen
Mainframe Evangelist
CDW
www.cdw.com/content/cdw/en/solutions/ibm-zsystems.html
Original Message:
Sent: Mon July 24, 2023 03:14 PM
From: Aswini Abraham
Subject: JSON Parser in PL/I
Thank you Scott for the details. I would like to know more about the option -
- z/OS JSON parser to parse JSON text coming from any source and the ability to build new JSON text or add to existing JSON text.
I am new to IBM explorer for z/OS. I am able to create service and API using z/OS connect and I could test a few services successfully by sending request JSON and receiving expected response JSON. So can you please guide on how to check for z/OS JSON parser in z/OS connect. So does this require change in both service/API and application program(PL/I)? Can you please provide a sample code/pseudo code for implementing this.
Thanks,
Aswini Abraham
------------------------------
Aswini Abraham
Original Message:
Sent: Mon July 24, 2023 02:40 PM
From: Scott Fagen
Subject: JSON Parser in PL/I
I'd have a look at the z/OS Client Web Enablement Toolkit: https://www.ibm.com/docs/en/zos/2.5.0?topic=languages-zos-client-web-enablement-toolkit.
z/OS Client Web Enablement Toolkit
- Description:
- Applications running in traditional z/OS environments can choose to play the client role of a RESTful web application and initiate a request to a web server residing on z/OS or any other platform supporting web applications. In z/OS Version Release 2, the new z/OS Client Web Enablement toolkit enables these applications to more easily participate in this client/server space by providing a built-in:
- z/OS JSON parser to parse JSON text coming from any source and the ability to build new JSON text or add to existing JSON text.
- z/OS HTTP/HTTPS protocol enabler using interfaces similar in nature to other industry-standard APIs.
The intention of the toolkit is to enable traditional z/OS programs apart from a Java Virtual Machine (JVM) environment to have easy access to these types of services. Programs running as a batch job, as a started procedure or running in almost any address space on a z/OS system now have APIs that they can utilize in a similar manner to any standard z/OS APIs provided by the operating system. Furthermore, programs can invoke these APIs in the programming language of their choice. C/C++, COBOL, PL/I, and Assembler languages are fully supported.
------------------------------
Scott Fagen
Mainframe Evangelist
CDW
www.cdw.com/content/cdw/en/solutions/ibm-zsystems.html
Original Message:
Sent: Mon July 24, 2023 10:17 AM
From: Aswini Abraham
Subject: JSON Parser in PL/I
Hi All,
Is it possible to parse JSON data in PL/I? My requirement is to parse request JSON received through z/OS connect and use those key fields and values in constructing a WHERE clause dynamically for DB2 query in my program.
eg:
Request received:
{ { EMP_ID:'abc',EMP_NAME:'abc',EMP_NO:'20',EMP_REG:[1,4,5,6],EMP_STATUS:'A'},
{ EMP_ID:'xyz',EMP_NAME:'acd',EMP_NO:'10',EMP_REG:[9,10],EMP_STATUS:'A'},
…
….
… }
Expected WHERE clause in program (after parsing and appending data wherever needed):
SELECT COL1, COL2
FROM TABLE1
WHERE
((EMP_ID='abc' AND EMP_NAME='abc' AND EMP_NO='20' AND EMP_REG=[1,4,5,6] AND EMP_status='A') OR
(EMP_ID='xyz' AND EMP_NAME='acd' AND EMP_NO='10' AND EMP_REG=[9,10] AND EMP_status='A'} OR
…
….
… ))
Is there a concept 'JSON Parser' in PL/I? Any leads would be appreciated.
Thanks,
Aswini Abraham
------------------------------
Aswini Abraham
------------------------------