Discussion:
Anyone here exprerienced in JSON parser (assembler)
(too old to reply)
ITschak Mugzach
2018-08-18 09:38:12 UTC
Permalink
I have a program that prses Json text written in assembler, and same code
in Rexx. The rexx code works fine. When I try to parse a Json array entry,
I get an error "objecthandle must be zero for globl search". however, my
search is hwtz_searchtype_object... Again, the Rexx code which is one to
one with the assembler runs perfect, but I want it in assembler.

ITschak


ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *


nbsp;*| *

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Martin Packer
2018-08-18 15:55:20 UTC
Permalink
(I guess I’m not alone in this and) I’m scratching my head as to what
you’re talking about.) I know “JSON” and Assembler and Rexx but I have no
idea what the specific code you’re talking about is or where both flavours
came from.

It’d probably help if you told us.

Thanks, Martin

Sent from my iPad
Post by ITschak Mugzach
I have a program that prses Json text written in assembler, and same code
in Rexx. The rexx code works fine. When I try to parse a Json array entry,
I get an error "objecthandle must be zero for globl search". however, my
search is hwtz_searchtype_object... Again, the Rexx code which is one to
one with the assembler runs perfect, but I want it in assembler.
ITschak
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *
nbsp;*| *
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-08-18 16:45:03 UTC
Permalink
https://www.ibm.com/support/knowledgecenter/SSLTBW_2.2.0/com.ibm.zos.v2r2.ieac100/ieac1-cwe-json.htm ?

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Martin Packer
Sent: Saturday, August 18, 2018 10:55 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: Anyone here exprerienced in JSON parser (assembler)


(I guess I’m not alone in this and) I’m scratching my head as to what
you’re talking about.) I know “JSON” and Assembler and Rexx but I have no
idea what the specific code you’re talking about is or where both flavours
came from.

It’d probably help if you told us.

Thanks, Martin

Sent from my iPad
Post by ITschak Mugzach
I have a program that prses Json text written in assembler, and same code
in Rexx. The rexx code works fine. When I try to parse a Json array entry,
I get an error "objecthandle must be zero for globl search". however, my
search is hwtz_searchtype_object... Again, the Rexx code which is one to
one with the assembler runs perfect, but I want it in assembler.
ITschak
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *
nbsp;*| *
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
ITschak Mugzach
2018-08-20 07:03:35 UTC
Permalink
Hi Martin, Charles.

Json Parser is a service loaded at IPl (much like subsystems does), and
supplies callable routines to parse Json format strings. I solved my
problem, but "gos save IBM" for unclear documentation. the rexx version was
quit easy as it was based on a sample, but the assembler routine is more
complex to understand.

so the answer to my question, "is there any doctor on board", is yes. it
migt be me ;-)

ITschak
Post by Martin Packer
(I guess I’m not alone in this and) I’m scratching my head as to what
you’re talking about.) I know “JSON” and Assembler and Rexx but I have no
idea what the specific code you’re talking about is or where both flavours
came from.
It’d probably help if you told us.
Thanks, Martin
Sent from my iPad
Post by ITschak Mugzach
I have a program that prses Json text written in assembler, and same code
in Rexx. The rexx code works fine. When I try to parse a Json array
entry,
Post by ITschak Mugzach
I get an error "objecthandle must be zero for globl search". however, my
search is hwtz_searchtype_object... Again, the Rexx code which is one to
one with the assembler runs perfect, but I want it in assembler.
ITschak
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *
nbsp;*| *
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Galina Gorelik
2018-08-21 19:19:03 UTC
Permalink
Hi ITschak,

I’m part of the team that develops the z/OS JSON parser. From your previous post, it appears you have resolved the issue you were experiencing.
As you pointed out, we do not provider assembler samples, so you have to connect the dots between the following three things:
1. IBM Knowledge Center, z/OS JSON parser: Description of HWTJ_SEARCHTYPE_GLOBAL that distinguishes between the REXX and non-REXX parameter content: for the first “name” that exactly matches the SearchString for REXX or the string pointed to by the SearchStringAddr parameter for non-REXX.
2. IBM Knowledge Center, z/OS JSON parser: Linkage considerations for assembler language programming that specifies: Register 1 must contain the address of a parameter list that is a list of consecutive words, each containing the address of a parameter to be passed.
3. HWTJIASM macro: HWTJSRCH input parameters section where the HWTJSRCHPARMLIST DSECT shows that these are all pointers to the parameters, in the case of the SearchStringAddr parameter, the DS indicates that this is a pointer to the address: HWTJSRCHSEARCHSTRINGADDRPTR DS A Address of SearchStringAddr

Is there additional information that can be added that would have helped more? Or verbiage that should be altered?

Galina

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Doug
2018-08-22 01:42:15 UTC
Permalink
Galina,
Yes, it would be worth providing sample code for batch assembler, CICS assembler, CICS COBOL , CICS REXX , TSO REXX and ‘how to’ direction for Liberty and eclipse. Sorry if I missed some, feel free to chime in.
By sample code we mean fully functional examples not a small KC tribute to a hint and click for KC to direct us to yet another tiny hint.
Just my 2cents..
Most of us are swamped with day to day problems and don’t have the extra band width to explore as we did in days gone by.
Best Regards,
Doug

.

On Aug 21, 2018, at 15:08, Galina Gorelik <***@US.IBM.COM> wrote:

Hi ITschak,

I’m part of the team that develops the z/OS JSON parser. From your previous post, it appears you have resolved the issue you were experiencing.
As you pointed out, we do not provider assembler samples, so you have to connect the dots between the following three things:
1. IBM Knowledge Center, z/OS JSON parser: Description of HWTJ_SEARCHTYPE_GLOBAL that distinguishes between the REXX and non-REXX parameter content: for the first “name” that exactly matches the SearchString for REXX or the string pointed to by the SearchStringAddr parameter for non-REXX.
2. IBM Knowledge Center, z/OS JSON parser: Linkage considerations for assembler language programming that specifies: Register 1 must contain the address of a parameter list that is a list of consecutive words, each containing the address of a parameter to be passed.
3. HWTJIASM macro: HWTJSRCH input parameters section where the HWTJSRCHPARMLIST DSECT shows that these are all pointers to the parameters, in the case of the SearchStringAddr parameter, the DS indicates that this is a pointer to the address: HWTJSRCHSEARCHSTRINGADDRPTR DS A Address of SearchStringAddr

Is there additional information that can be added that would have helped more? Or verbiage that should be altered?

Galina

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
ITschak Mugzach
2018-08-22 04:02:11 UTC
Permalink
Hello Galina,

I am reading IBM manuals for about 40 years, and it is hard to understand
the flow of the interface calls from the manual. I first wrote a rexx
program just to understand the flow. It also helped me to understand why
assembler calls are not executing well. I am not sure this is a proper tool
for parsing a complex, array structured JSON.
But,... I already mastered the service. a sample for the next users may
help them.

Best,
ITschak
Post by Doug
Galina,
Yes, it would be worth providing sample code for batch assembler, CICS
assembler, CICS COBOL , CICS REXX , TSO REXX and ‘how to’ direction for
Liberty and eclipse. Sorry if I missed some, feel free to chime in.
By sample code we mean fully functional examples not a small KC tribute to
a hint and click for KC to direct us to yet another tiny hint.
Just my 2cents..
Most of us are swamped with day to day problems and don’t have the extra
band width to explore as we did in days gone by.
Best Regards,
Doug
.
Hi ITschak,
I’m part of the team that develops the z/OS JSON parser. From your
previous post, it appears you have resolved the issue you were experiencing.
As you pointed out, we do not provider assembler samples, so you have to
1. IBM Knowledge Center, z/OS JSON parser: Description of
HWTJ_SEARCHTYPE_GLOBAL that distinguishes between the REXX and non-REXX
parameter content: for the first “name” that exactly matches the
SearchString for REXX or the string pointed to by the SearchStringAddr
parameter for non-REXX.
2. IBM Knowledge Center, z/OS JSON parser: Linkage considerations for
assembler language programming that specifies: Register 1 must contain the
address of a parameter list that is a list of consecutive words, each
containing the address of a parameter to be passed.
3. HWTJIASM macro: HWTJSRCH input parameters section where the
HWTJSRCHPARMLIST DSECT shows that these are all pointers to the parameters,
in the case of the SearchStringAddr parameter, the DS indicates that this
is a pointer to the address: HWTJSRCHSEARCHSTRINGADDRPTR DS A Address
of SearchStringAddr
Is there additional information that can be added that would have helped
more? Or verbiage that should be altered?
Galina
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-08-22 06:48:03 UTC
Permalink
Post by ITschak Mugzach
I am reading IBM manuals for about 40 years, and it is hard to understand
the flow of the interface calls from the manual. I first wrote a rexx
program just to understand the flow. It also helped me to understand why
assembler calls are not executing well. I am not sure this is a proper tool
for parsing a complex, array structured JSON.
IMO, assembler isn't the right language to be parsing complex JSON
documents. I couldn't think of a worse
language for the job.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-08-22 15:41:51 UTC
Permalink
AWK? BASIC? RPG?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of David Crayford <***@GMAIL.COM>
Sent: Wednesday, August 22, 2018 2:47 AM
To: IBM-***@listserv.ua.edu
Subject: Re: Anyone here exprerienced in JSON parser (assembler)
Post by ITschak Mugzach
I am reading IBM manuals for about 40 years, and it is hard to understand
the flow of the interface calls from the manual. I first wrote a rexx
program just to understand the flow. It also helped me to understand why
assembler calls are not executing well. I am not sure this is a proper tool
for parsing a complex, array structured JSON.
IMO, assembler isn't the right language to be parsing complex JSON
documents. I couldn't think of a worse
language for the job.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-08-22 15:51:43 UTC
Permalink
*Personally* I agree, but different languages for different folks. Some people are very comfortable in assembler, especially with the structured macros. I think I can state with some confidence that if @EdJaffe need to parse some JSON documents he would do it from assembler.

COBOL does not seem like a great choice either to me personally, but some folks, and especially some shops, are most comfortable with COBOL.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of David Crayford

IMO, assembler isn't the right language to be parsing complex JSON
documents. I couldn't think of a worse
language for the job.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Kirk Wolf
2018-08-22 16:46:24 UTC
Permalink
I've used the IBM JSON parser, from C.
I don't see why it would be ill suited for assembler more than anything
else :-)
Post by Charles Mills
*Personally* I agree, but different languages for different folks. Some
people are very comfortable in assembler, especially with the structured
parse some JSON documents he would do it from assembler.
COBOL does not seem like a great choice either to me personally, but some
folks, and especially some shops, are most comfortable with COBOL.
Charles
-----Original Message-----
Behalf Of David Crayford
IMO, assembler isn't the right language to be parsing complex JSON
documents. I couldn't think of a worse
language for the job.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-08-22 22:40:12 UTC
Permalink
Post by Kirk Wolf
I've used the IBM JSON parser, from C.
I don't see why it would be ill suited for assembler more than anything
else :-)
I'm doing a lot of JSON work right now and one task was to create a JSON
to YAML convertor for swagger documents.
The elegant solution was to use recursion which is difficult to do in
assembler. It's difficult to do in COBOL too.

I would be interested to know why you used the IBM JSON parser? One only
has to browse the C sample in SYS1.SAMPLIB to
conclude it's a inelegant beast with a bloated API. I can only assume
that you were working on a project that precluded open source software?

I've used several open source C/C++ JSON libraries on z/OS. They're easy
to port (just tweaked to handle UTF8 escape sequences if you want to
process EBCDIC).
I've used YAJL [1] from C but much prefer C++ libraries with map like
interfaces and STL compatible iterators. JsonCpp [2] is quite good but I
prefer picojson [3]
which also has a streaming API.

[1] https://github.com/lloyd/yajl
[2] http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html
[3] https://github.com/kazuho/picojson
Post by Kirk Wolf
Post by Charles Mills
*Personally* I agree, but different languages for different folks. Some
people are very comfortable in assembler, especially with the structured
parse some JSON documents he would do it from assembler.
COBOL does not seem like a great choice either to me personally, but some
folks, and especially some shops, are most comfortable with COBOL.
Charles
-----Original Message-----
Behalf Of David Crayford
IMO, assembler isn't the right language to be parsing complex JSON
documents. I couldn't think of a worse
language for the job.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Smith
2018-08-22 23:44:31 UTC
Permalink
Recursion in assembler is hardly difficult.  Knowing how to implement a
stack is fundamental.  Smart programmers not only do, but haven't even
thought about it other than when architecture improvements require an
upgrade.

sas

p.s. Aha!  Spellchecker wants to replace Crayford with Crawford. I will
have it whipped :-)
Post by David Crayford
Post by Kirk Wolf
I've used the IBM JSON parser, from C.
I don't see why it would be ill suited for assembler more than anything
else :-)
I'm doing a lot of JSON work right now and one task was to create a
JSON to YAML convertor for swagger documents.
The elegant solution was to use recursion which is difficult to do in
assembler. It's difficult to do in COBOL too.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-08-23 19:46:48 UTC
Permalink
recursion which is difficult to do in assembler.
Almost as difficult as breathing. The same programming techniques that you use to make a program reentrant and reshble also make it recursive.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of David Crayford <***@GMAIL.COM>
Sent: Wednesday, August 22, 2018 6:39:57 PM
To: IBM-***@listserv.ua.edu
Subject: Re: Anyone here exprerienced in JSON parser (assembler)
I've used the IBM JSON parser, from C.
I don't see why it would be ill suited for assembler more than anything
else :-)
I'm doing a lot of JSON work right now and one task was to create a JSON
to YAML convertor for swagger documents.
The elegant solution was to use recursion which is difficult to do in
assembler. It's difficult to do in COBOL too.

I would be interested to know why you used the IBM JSON parser? One only
has to browse the C sample in SYS1.SAMPLIB to
conclude it's a inelegant beast with a bloated API. I can only assume
that you were working on a project that precluded open source software?

I've used several open source C/C++ JSON libraries on z/OS. They're easy
to port (just tweaked to handle UTF8 escape sequences if you want to
process EBCDIC).
I've used YAJL [1] from C but much prefer C++ libraries with map like
interfaces and STL compatible iterators. JsonCpp [2] is quite good but I
prefer picojson [3]
which also has a streaming API.

[1] https://secure-web.cisco.com/1dQuLCYj_M7Fegc0i1UpcKTPdY2D-sIz6P26MwxQ_82kBvP115oBjZ5ELlPu4lT2i6WBqGdCYEbnLzCBiIMMRcNsj432zhVMvTcHIagv4pVBDr9N3erdaZjfseglUPwzXLdaMX6wUOThs6nhH-HI6qdtKeuNKeZB4B-awgLL6Ikfg-0ORE4kAW0XhwEBO_yec0FmkO3Q7hNm0DZDonNJJAyo34MSenTXubaLUXytQHo9ECGFj4Z0XueS0sSN64KKUvZqLsE40AMWLEBTSLE9gAJsLHd4mR1woM6DC9DLPYJ3cpD8j3iBaYgcHfeKY9YWBoUSTQxY0fSkTKMliy5RGb32wY_T3XmFDr_PyVmZBmwhf-O-ghRY8p7qcKXX-zTcti--UfsVFOynA_oU83c_7zKJkQKCCS9C5YTrGuvYll6i0RcRP4nTqYrt30MyyIYq1kgICzA55a2sr1XWVjjLndQ/https%3A%2F%2Fgithub.com%2Flloyd%2Fyajl
[2] http://secure-web.cisco.com/1PDSVKjeBXdcIZdmyYgGqHu93IvqWONavw66fHj6NUQXztO7M8_6Kk-fQ4A3RZMVdFy8YTx8r1w5JCeRpLaU2w3BtEYmKZcNFyZ4QMpJRc7LOhlmUO2KL__qVt2TCDA6AntwP5jrW9EJbPwSxsyngEKIIHC2FzXgKlBOYHYm1nO9tsW5Hx3rmI01LZ45mtTK7uZfjzzVyRm2Itt-EUvJPJfd5iEHgLgWJR_8P7GzxphbYClRBMsMKVgXVrlfn_RjlNjLid83rK0KJam0NFbR9jTI8GheuTXOJQ_8Viq_ZtMNaiRDqqMBhTLbTz2kgu9P3LwhdDaIkn1S5oAo7N9y6zkAwq_2SKsX05owCRJDBFDsVJZTSSV4GzFQJroW0I11iJ_hI9zRm_hl5xnJA1u_P9kNNH7Kig8gpKar_kKkOwSsYACpi7Ejfjh81tVMyJFHXrd-SKp8-FiHWyu7SnG1mfQ/http%3A%2F%2Fopen-source-parsers.github.io%2Fjsoncpp-docs%2Fdoxygen%2Findex.html
[3] https://secure-web.cisco.com/1lPL8IZPxRiZHhoU0KMRNlwao6onwga-6npaxG_q49gRIxQJF6xboseSJyTva5Z36K2fvzSqfexRJKrxSSBzAeHDB9dlkmIvPjRnTG8IkSOqX3KLQLf3PcCZDiA-aIXN4f_18w7Y2tJNdI7J2IAz7OzlJBXPbNGFuJtfDWJBacmcI3J0QLPFEl4y3ODDJHFlcAUmSBEAgEMJigpIwn3tDSv2mvh6nxnP5HyMg6PUcF2p9F-iwWQcG5imfvyVy7XVE_om2oD-2BKdatyG9GoXOs1QRFgvEINUaTyXpbeifSQWLnfwN461qo0p92mK4GXc4c5wBk3uUYTO3o6PGB9t4jy1rl-2ZBw2LsdIkzhy0xQcjDyxRjfyM2s4nQFZLHg4BmEg-X6RfdZ932zgZVm15P16OQeZibMRE6vbMe7AsbJwQtyMTtXp6hxE9BIP8eKd9vo-GsduDMn2174oQyrENMg/https%3A%2F%2Fgithub.com%2Fkazuho%2Fpicojson
Post by Charles Mills
*Personally* I agree, but different languages for different folks. Some
people are very comfortable in assembler, especially with the structured
parse some JSON documents he would do it from assembler.
COBOL does not seem like a great choice either to me personally, but some
folks, and especially some shops, are most comfortable with COBOL.
Charles
-----Original Message-----
Behalf Of David Crayford
IMO, assembler isn't the right language to be parsing complex JSON
documents. I couldn't think of a worse
language for the job.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-08-22 23:56:18 UTC
Permalink
Why do t you Demi started to us how easy it is? 😀
Post by Kirk Wolf
I've used the IBM JSON parser, from C.
I don't see why it would be ill suited for assembler more than anything
else :-)
Post by Charles Mills
*Personally* I agree, but different languages for different folks. Some
people are very comfortable in assembler, especially with the structured
parse some JSON documents he would do it from assembler.
COBOL does not seem like a great choice either to me personally, but some
folks, and especially some shops, are most comfortable with COBOL.
Charles
-----Original Message-----
Behalf Of David Crayford
IMO, assembler isn't the right language to be parsing complex JSON
documents. I couldn't think of a worse
language for the job.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-08-23 07:08:09 UTC
Permalink
Maybe, but I'm not so sure. If that JSON is coming over the wire into a
Java web application like EJES Web then I would expect it to be
serialized to a byte array in the Java layer. That's how we do it. No
JSON ever reaches the assembler layer in our stack.
Post by Charles Mills
COBOL does not seem like a great choice either to me personally, but some folks, and especially some shops, are most comfortable with COBOL.
Charles
-----Original Message-----
IMO, assembler isn't the right language to be parsing complex JSON
documents. I couldn't think of a worse
language for the job.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-08-22 07:03:49 UTC
Permalink
Post by Doug
Galina,
Yes, it would be worth providing sample code for batch assembler, CICS assembler, CICS COBOL , CICS REXX , TSO REXX and ‘how to’ direction for Liberty and eclipse. Sorry if I missed some, feel free to chime in.
I think you'll be living in hope if you expect that lot! CICS COBOL will
almost certainly use CICS JSON  web services. Liberty and Eclipse are
Java environments so parsing JSON is as simple as using an annotation
based library like Jackson.
As for assembler,  if somebody really wants to parse JSON in a 2GL they
should be smart enough to understand the documentation :)
Post by Doug
By sample code we mean fully functional examples not a small KC tribute to a hint and click for KC to direct us to yet another tiny hint.
Just my 2cents..
Most of us are swamped with day to day problems and don’t have the extra band width to explore as we did in days gone by.
Best Regards,
Doug
.
Hi ITschak,
I’m part of the team that develops the z/OS JSON parser. From your previous post, it appears you have resolved the issue you were experiencing.
1. IBM Knowledge Center, z/OS JSON parser: Description of HWTJ_SEARCHTYPE_GLOBAL that distinguishes between the REXX and non-REXX parameter content: for the first “name” that exactly matches the SearchString for REXX or the string pointed to by the SearchStringAddr parameter for non-REXX.
2. IBM Knowledge Center, z/OS JSON parser: Linkage considerations for assembler language programming that specifies: Register 1 must contain the address of a parameter list that is a list of consecutive words, each containing the address of a parameter to be passed.
3. HWTJIASM macro: HWTJSRCH input parameters section where the HWTJSRCHPARMLIST DSECT shows that these are all pointers to the parameters, in the case of the SearchStringAddr parameter, the DS indicates that this is a pointer to the address: HWTJSRCHSEARCHSTRINGADDRPTR DS A Address of SearchStringAddr
Is there additional information that can be added that would have helped more? Or verbiage that should be altered?
Galina
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
ITschak Mugzach
2018-08-22 07:32:23 UTC
Permalink
Aha
Post by Doug
Post by Doug
Galina,
Yes, it would be worth providing sample code for batch assembler, CICS
assembler, CICS COBOL , CICS REXX , TSO REXX and ‘how to’ direction for
Liberty and eclipse. Sorry if I missed some, feel free to chime in.
I think you'll be living in hope if you expect that lot! CICS COBOL will
almost certainly use CICS JSON web services. Liberty and Eclipse are
Java environments so parsing JSON is as simple as using an annotation
based library like Jackson.
As for assembler, if somebody really wants to parse JSON in a 2GL they
should be smart enough to understand the documentation :)
Post by Doug
By sample code we mean fully functional examples not a small KC tribute
to a hint and click for KC to direct us to yet another tiny hint.
Post by Doug
Just my 2cents..
Most of us are swamped with day to day problems and don’t have the extra
band width to explore as we did in days gone by.
Post by Doug
Best Regards,
Doug
.
Hi ITschak,
I’m part of the team that develops the z/OS JSON parser. From your
previous post, it appears you have resolved the issue you were experiencing.
Post by Doug
As you pointed out, we do not provider assembler samples, so you have to
1. IBM Knowledge Center, z/OS JSON parser: Description of
HWTJ_SEARCHTYPE_GLOBAL that distinguishes between the REXX and non-REXX
parameter content: for the first “name” that exactly matches the
SearchString for REXX or the string pointed to by the SearchStringAddr
parameter for non-REXX.
Post by Doug
2. IBM Knowledge Center, z/OS JSON parser: Linkage considerations for
assembler language programming that specifies: Register 1 must contain the
address of a parameter list that is a list of consecutive words, each
containing the address of a parameter to be passed.
Post by Doug
3. HWTJIASM macro: HWTJSRCH input parameters section where the
HWTJSRCHPARMLIST DSECT shows that these are all pointers to the parameters,
in the case of the SearchStringAddr parameter, the DS indicates that this
is a pointer to the address: HWTJSRCHSEARCHSTRINGADDRPTR DS A Address
of SearchStringAddr
Post by Doug
Is there additional information that can be added that would have helped
more? Or verbiage that should be altered?
Post by Doug
Galina
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
p***@gmail.com
2018-08-22 05:22:54 UTC
Permalink
Hi,

sorry to be late to the thread, but I have to agree with Itschak. It took me a bit of creative interpretation to get my assembler version going. As Itschak did, I found I had to use the REXX sample to make any sense of what was happening...very nice, but not assembler. The COBOL one HWTJXCB1 was also instructive.

Simple working samples, like the COBOL or REXX ones but in ASM, would be very handy for future readers. Admittedly ASM isn't really the best tool for this job, but some of us just like to kick the tyres to see if we can really make something good or if it's "move on, nothing to see here".

cheers,
Peter
Post by ITschak Mugzach
I have a program that prses Json text written in assembler, and same code
in Rexx. The rexx code works fine. When I try to parse a Json array entry,
I get an error "objecthandle must be zero for globl search". however, my
search is hwtz_searchtype_object... Again, the Rexx code which is one to
one with the assembler runs perfect, but I want it in assembler.
ITschak
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *
nbsp;*| *
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
Jerry Callen
2018-08-24 12:33:48 UTC
Permalink
So I can't help but wonder: what's the big picture here? WHY is it necessary to parse JSON from assembler? There is presumably a good reason that assembler is in the driver's seat here, instead of, say, C, C++, or Python (all viable languages on z/OS).

Yes, it's certainly possible to write recursive assembler code, and possible to do it efficiently with a stack, but WHY? It would be easier in Metal C (if the environment dictates that), and VERY easy from LE C/C++ or Python. And for the bash scripters out there, there's a nifty little command line tool (the "jq" command) that will parse JSON and deliver it in a convenient form to a shell script. (Rocket has it ported to z/OS internally, but not yet available for download.)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
ITschak Mugzach
2018-08-24 19:54:26 UTC
Permalink
Oh, that's easy to answer. I do Assembler as I don't speak the other
languages...

ITschak
Post by Jerry Callen
So I can't help but wonder: what's the big picture here? WHY is it
necessary to parse JSON from assembler? There is presumably a good reason
that assembler is in the driver's seat here, instead of, say, C, C++, or
Python (all viable languages on z/OS).
Yes, it's certainly possible to write recursive assembler code, and
possible to do it efficiently with a stack, but WHY? It would be easier in
Metal C (if the environment dictates that), and VERY easy from LE C/C++ or
Python. And for the bash scripters out there, there's a nifty little
command line tool (the "jq" command) that will parse JSON and deliver it in
a convenient form to a shell script. (Rocket has it ported to z/OS
internally, but not yet available for download.)
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Tom Ross
2018-08-27 17:15:58 UTC
Permalink
*Personally* I agree, but different languages for different folks. Some p=
eople are very comfortable in assembler, especially with the structured mac=
e some JSON documents he would do it from assembler.
Maybe, but I'm not so sure. If that JSON is coming over the wire into a=20
Java web application like EJES Web then I would expect it to be=20
serialized to a byte array in the Java layer. That's how we do it. No=20
JSON ever reaches the assembler layer in our stack.
COBOL does not seem like a great choice either to me personally, but some=
folks, and especially some shops, are most comfortable with COBOL.
The JSON PARSE statement in COBOL is the keasiest way to parse JSON ever!
You just point to a data item which contains your UTF-8 JSON text, and give
the name of a COBOL data structure (group) that you want the values from the
JSON Name/Value pairs top go into, and let COBOL do all the work for you!

You do have to be up to the 2017 COBOL compiler level, since that is when we
delivered JSON PARSE, in COBOL V6.2.

Cheers,
TomR >> COBOL is the Language of the Future! <<

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-08-28 03:44:21 UTC
Permalink
Post by Tom Ross
COBOL does not seem like a great choice either to me personally, but some=
folks, and especially some shops, are most comfortable with COBOL.
The JSON PARSE statement in COBOL is the keasiest way to parse JSON ever!
You can't argue with that! Almost as easy as JavaScript :)

let obj = JSON.parse('{ "name":"John", "age":30, "city":"New York"}');

Is there a COBOL equivalent to JSON.stringify?
Post by Tom Ross
You just point to a data item which contains your UTF-8 JSON text, and give
the name of a COBOL data structure (group) that you want the values from the
JSON Name/Value pairs top go into, and let COBOL do all the work for you!
You do have to be up to the 2017 COBOL compiler level, since that is when we
delivered JSON PARSE, in COBOL V6.2.
Cheers,
TomR >> COBOL is the Language of the Future! <<
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
ITschak Mugzach
2018-08-28 06:10:44 UTC
Permalink
Tom,

The program executes in key zero & supervisor mode. this is how it get
control. Not sure I can write it in Cobol.
Post by Tom Ross
Post by Charles Mills
Post by Charles Mills
*Personally* I agree, but different languages for different folks. Some
p=
Post by Charles Mills
eople are very comfortable in assembler, especially with the structured
mac=
pars=
Post by Charles Mills
e some JSON documents he would do it from assembler.
Maybe, but I'm not so sure. If that JSON is coming over the wire into a=20
Java web application like EJES Web then I would expect it to be=20
serialized to a byte array in the Java layer. That's how we do it. No=20
JSON ever reaches the assembler layer in our stack.
Post by Charles Mills
COBOL does not seem like a great choice either to me personally, but
some=
Post by Charles Mills
Post by Charles Mills
folks, and especially some shops, are most comfortable with COBOL.
The JSON PARSE statement in COBOL is the keasiest way to parse JSON ever!
You just point to a data item which contains your UTF-8 JSON text, and give
the name of a COBOL data structure (group) that you want the values from the
JSON Name/Value pairs top go into, and let COBOL do all the work for you!
You do have to be up to the 2017 COBOL compiler level, since that is when we
delivered JSON PARSE, in COBOL V6.2.
Cheers,
TomR >> COBOL is the Language of the Future! <<
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
ITschak Mugzach
*|** IronSphere Platform* *|* *Information Security Contiguous Monitoring
for Legacy **| *

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Tom Ross
2018-08-28 16:33:33 UTC
Permalink
Post by David Crayford
Post by Tom Ross
COBOL does not seem like a great choice either to me personally, but so=
me=3D
Post by Tom Ross
folks, and especially some shops, are most comfortable with COBOL.
The JSON PARSE statement in COBOL is the keasiest way to parse JSON ever!
You can't argue with that! Almost as easy as JavaScript :)
let obj =3D JSON.parse('{ "name":"John", "age":30, "city":"New York"}');
Is there a COBOL equivalent to JSON.stringify?
Yes! It is the JSON GENERATE statement, available in 2016 in COBOL V6.1

Cheers,
TomR >> COBOL is the Language of the Future! <<

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-08-29 01:14:02 UTC
Permalink
Post by Tom Ross
You can't argue with that! Almost as easy as JavaScript:)
let obj =3D JSON.parse('{ "name":"John", "age":30, "city":"New York"}');
Is there a COBOL equivalent to JSON.stringify?
Yes! It is the JSON GENERATE statement, available in 2016 in COBOL V6.1
Awesome! I'm guessing it uses the same environment as the XML
parser/generator?

The tricky part comes when the structure of the JSON is unknown and has
to be traversed by node.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Tom Ross
2018-08-29 16:04:27 UTC
Permalink
Post by Tom Ross
Post by David Crayford
Is there a COBOL equivalent to JSON.stringify?
Yes! It is the JSON GENERATE statement, available in 2016 in COBOL V6.1
Awesome! I'm guessing it uses the same environment as the XML
parser/generator?
Well, it runs in the COBOL environment, so if you are talking about
COBOL XML GENERATE and XML PARSE (COMPAT), then yes. If you are talking about
the XMLSS option COBOL XML PARSE, it runs in a mixture of COBOL and
'z/OS XML System Services' parser environments.
Post by Tom Ross
The tricky part comes when the structure of the JSON is unknown and has=20
to be traversed by node.
Well, JSOPN is for RESTful services, where you tell clients what the JSON
for a service request should look like. The client and the service have to
know a little about each other. Good luck with your project!

Cheers,
TomR >> COBOL is the Language of the Future! <<

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Martin Packer
2018-08-29 18:48:54 UTC
Permalink
s/JSOPN/JSONP/ ?

Cheers, Martin

Sent from my iPad
Post by Tom Ross
Post by Tom Ross
Post by David Crayford
Is there a COBOL equivalent to JSON.stringify?
Yes! It is the JSON GENERATE statement, available in 2016 in COBOL V6.1
Awesome! I'm guessing it uses the same environment as the XML
parser/generator?
Well, it runs in the COBOL environment, so if you are talking about
COBOL XML GENERATE and XML PARSE (COMPAT), then yes. If you are talking about
the XMLSS option COBOL XML PARSE, it runs in a mixture of COBOL and
'z/OS XML System Services' parser environments.
Post by Tom Ross
The tricky part comes when the structure of the JSON is unknown and has=20
to be traversed by node.
Well, JSOPN is for RESTful services, where you tell clients what the JSON
for a service request should look like. The client and the service have to
know a little about each other. Good luck with your project!
Cheers,
TomR >> COBOL is the Language of the Future! <<
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Tom Ross
2018-08-29 16:06:33 UTC
Permalink
Post by ITschak Mugzach
Tom,
The program executes in key zero & supervisor mode. this is how it get
control. Not sure I can write it in Cobol.
Well, you could WRITE it in COBOL, but you could not run it :-)-
COBOL can only run in problem state.

Cheers,
TomR >> COBOL is the Language of the Future! <<

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...