View previous topic :: View next topic
|
Author |
Message |
mbattu
New User
Joined: 19 Jan 2011 Posts: 15 Location: Toronto
|
|
|
|
Hi,
I have a requirement to process a large JSON file (> 10Mb) with complex structure. I am using JSON Parse with V6.3 compiler and Z/OS 2.6.
I am able parse the Json only when I limit the variable size to pic x(1600000). If the size is increased, job is failing with space issue.
Any inputs how to parse Large Json files
Code: |
05 json-jtxt-1208 PIC X(1600000) VALUE SPACE. |
Code: |
JSON PARSE json-jtxt-1208 into applicationArea
WITH DETAIL
ON EXCEPTION
DISPLAY "UNSUCCESSFUL JSON PARSE"
DISPLAY "json-code :"json-code
DISPLAY "json-status :"json-status
NOT ON EXCEPTION
DISPLAY "SUCCESSFUL JSON PARSE"
END-JSON. |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Quote: |
If the size is increased, job is failing with space issue. |
What is the error message that you get? Space issue can be many numbers of variations. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
The limitation is something with your site. I've parsed JSON variables with 10 million bytes with no problems. Depending upon your site, you may need to adjust the region or MEMLIMIT parameter for the job and/or the step, but there's no inherent limit to COBOL variables other than what the compiler imposes. If you're using compiler option LP32 you are limited to 999,999,999 bytes per variable. If you're using compiler option LP64 you are limited to 2,147,483,646 bytes per variable. These limits will depend upon your region and MEMLIMIT specifications. |
|
Back to top |
|
|
mbattu
New User
Joined: 19 Jan 2011 Posts: 15 Location: Toronto
|
|
|
|
Robert Sample wrote: |
The limitation is something with your site. I've parsed JSON variables with 10 million bytes with no problems. Depending upon your site, you may need to adjust the region or MEMLIMIT parameter for the job and/or the step, but there's no inherent limit to COBOL variables other than what the compiler imposes. If you're using compiler option LP32 you are limited to 999,999,999 bytes per variable. If you're using compiler option LP64 you are limited to 2,147,483,646 bytes per variable. These limits will depend upon your region and MEMLIMIT specifications. |
Thanks for your reply Robert. Yes, I checked with my systems team and it is the limit imposed at our site. Is there any other solution like parsing the JSON in segments (like in XML parse with PROCESSING PROCEDURE and moving 1 to XMLCODE).
I think we can't use LP64 on JSON Parse yet. Anyways it doesn't matter to my problem as I can't make use of full 999,999,999 bytes with LP32 |
|
Back to top |
|
|
haroldo
New User
Joined: 13 Nov 2018 Posts: 2 Location: Chile
|
|
Back to top |
|
|
|