Skip to main content

Hi,

Any sample on how to read a JSON file and using JSON PARSE?

Regards



------------------------------
Juan Manuel Urraburu
Director, Information Technology
ProRM Uruguay
Montevideo UY
------------------------------

Hi,

Any sample on how to read a JSON file and using JSON PARSE?

Regards



------------------------------
Juan Manuel Urraburu
Director, Information Technology
ProRM Uruguay
Montevideo UY
------------------------------

The documentation Appendix has a simple example.  https://mitreattack.microfocus.com/documentation/extend-acucobol/1051/extend-interoperability-suite/GUID-90EF4285-AA64-491A-9425-9142E1146897.html



------------------------------
Stephen Hjerpe
Retired
Rocket Forum Shared Account
San Diego CA United States
------------------------------

The documentation Appendix has a simple example.  https://mitreattack.microfocus.com/documentation/extend-acucobol/1051/extend-interoperability-suite/GUID-90EF4285-AA64-491A-9425-9142E1146897.html



------------------------------
Stephen Hjerpe
Retired
Rocket Forum Shared Account
San Diego CA United States
------------------------------

Docs link for Rocket hosted docs in case Opentext remove the docs that they are hosting (which they are starting to do) https://docs.rocketsoftware.com/bundle/acucobolgt_dg_1051_html/page/GUID-90EF4285-AA64-491A-9425-9142E1146897.html



------------------------------
Martin Turner
Developer/Engineer
Rocket Forum Shared Account
Newbury United Kingdom
------------------------------

The documentation Appendix has a simple example.  https://mitreattack.microfocus.com/documentation/extend-acucobol/1051/extend-interoperability-suite/GUID-90EF4285-AA64-491A-9425-9142E1146897.html



------------------------------
Stephen Hjerpe
Retired
Rocket Forum Shared Account
San Diego CA United States
------------------------------

Hi Stephen,

Thanks, I know it.

What do you propose to read the json file? Because the sample uses fixed data into the program.

Regards,



------------------------------
Juan Manuel Urraburu
Director, Information Technology
ProRM Uruguay
Montevideo UY
------------------------------

Hi Stephen,

Thanks, I know it.

What do you propose to read the json file? Because the sample uses fixed data into the program.

Regards,



------------------------------
Juan Manuel Urraburu
Director, Information Technology
ProRM Uruguay
Montevideo UY
------------------------------

There is a srtndard, sample/json/jparse.cbl sample which shows that the COBOL program is laying out the data and then parsing it back. Or, take a look at the AcuToWeb atw-jparse example. Both examples show you do need to know how the data is laid out in order to parse it. That atw-jparse examples is using JSON data that's hosted on a web site, and the data types are defined in the COBOL data division. 

01 top-level.
       03 coord.
           05 lon pic S9(3)V9(4).
           05 lat pic S9(3)V9(4).
       03 n pic 9(3) value 1.
       03 main.
           05 temp pic 9(3)v9(1).
           05 feels_like pic s9(3)v9(1).
           05 temp_min pic 9(3)v9(1).
           05 temp_max pic 9(3)v9(1).
           05 pressure pic 9(5).
           05 humidity pic 9(3).
           05 sea_level pic 9(4).
           05 grnd_level pic 9(3).
I hope this helps.



------------------------------
Stephen Hjerpe
Retired
Rocket Forum Shared Account
San Diego CA United States
------------------------------

The documentation Appendix has a simple example.  https://mitreattack.microfocus.com/documentation/extend-acucobol/1051/extend-interoperability-suite/GUID-90EF4285-AA64-491A-9425-9142E1146897.html



------------------------------
Stephen Hjerpe
Retired
Rocket Forum Shared Account
San Diego CA United States
------------------------------

What is the minimum Acu version that supports JSON PARSE?



------------------------------
Juan Manuel Urraburu
Director, Information Technology
ProRM Uruguay
Montevideo UY
------------------------------

What is the minimum Acu version that supports JSON PARSE?



------------------------------
Juan Manuel Urraburu
Director, Information Technology
ProRM Uruguay
Montevideo UY
------------------------------

I believe Version 10.4.0 was the first version to have the JSOB PARSE feature.



------------------------------
Stephen Hjerpe
Retired
Rocket Forum Shared Account
San Diego CA United States
------------------------------

I believe Version 10.4.0 was the first version to have the JSOB PARSE feature.



------------------------------
Stephen Hjerpe
Retired
Rocket Forum Shared Account
San Diego CA United States
------------------------------

Hi, thanks Steve,

You are right the JSON parse feature was introduced with 10.4.

Regards,

Dominique



------------------------------
Dominique Sacre
Principal Product Manager
Rocket Internal - All Brands
Paris FR
------------------------------

Hi,

Any sample on how to read a JSON file and using JSON PARSE?

Regards



------------------------------
Juan Manuel Urraburu
Director, Information Technology
ProRM Uruguay
Montevideo UY
------------------------------

I wrote my own callable programs to parse JSON and xml



------------------------------
Peter Clayton
Developer
Cobsolv Cc
Midrand ZA
------------------------------