Midrange News for the IBM i Community

Posted by: Rich Wahlgren
QzhbCgiParse ZhbBuffer Lenght of 99999 limit?
has no ratings.
Published: 03 Jun 2016
Revised: 03 Jun 2016 - 2911 days ago
Last viewed on: 22 May 2024 (3267 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

QzhbCgiParse ZhbBuffer Lenght of 99999 limit? Published by: Rich Wahlgren on 03 Jun 2016 view comments(2)

V7R1 TR11

Good morning:

Need some feed back/experience/suggestions with increating zhbBuffer > 99999 when using QzhbCgiParse. At times we get a large web order and the total length is > 99999 characters and causes the API error out. I do realise that there is a lot empty XML tags that repeat themselves in the XML coming over and trying to get the web people to recude that, but until that is corrected I am stuck with what I have.

The code example is below

C                   callb (e) 'QzhbCgiParse'                      
C                   parm                    zhbCmd                
C                   parm                    zhbFormat             
C                   parm                    zhbBuffer             
C                   parm                    zhbBufLen             
C                   parm                    zhbRspLen             
C                   parm                    QUSEC                

D zhbCmd          s              6                            
D zhbFormat       s              8    inz('CGII0200')     

D zhbBuffer       s         99999                            
D zhbBufLen       s              9b 0 inz(%len(zhbBuffer))    
D zhbRspLen       s              9b 0 inz(0)       


Thanks, Rich Wahlgren

Integrated Merchandising Systems          

Return to midrangenews.com home page.
Sort Ascend | Descend


(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Comment on: QzhbCgiParse ZhbBuffer Lenght of 99999 limit?
Posted: 7 years 11 months 19 days 14 hours 9 minutes ago
Edited: Fri, 03 Jun, 2016 at 10:09:36 (2911 days ago)

Why don't you increase the field length to something larger and change those goofy "9b 0" fields to proper 10i 0 fields that they're supposed to be?  (Sorry, using the "b" data-types some 20-years after they were displaced with "i" data-types is one of those things that piss me off). frown

It isn't an API issue, it supports 16mb parameters. It is the way it is coded in your example--the 99999 limit is your doing.

Replace the 99999 with the LEN(xxx) keyword where xxx is the length of the field. For example: LEN(250000)

Posted by: rmwahlgren
Premium member *
Comment on: QzhbCgiParse ZhbBuffer Lenght of 99999 limit?
Posted: 7 years 11 months 19 days 12 hours 39 minutes ago

Thanks Bob, that was my gut feeling about the size (set by someone else) and the "b" data types being converted to INT.