RE: Options for YAJLINTO to handle a null array

Greg Wilburn <gwilburn-kuYYJ3CQfvZxq3Q2jbZZw/[email protected]> Tue, 24 Feb 2026 15:04:50 +0000
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <PH0PR17MB4863E283ABF14DF2BA036DBBDA74A@PH0PR17MB4863.namprd17.prod.outlook.com>
Thank you!

I've tried various iterations of using the countprefix option.  I was just surprised to see the count of the errors array at "1" when it's received as "null".  In this case, I supposed "errors" is present, but the underlying "field" and "messages" are not?

I'm considering creating separate DS for each situation and placing them in nested monitor statements... Or is that "bad form"?
I would expect to receive a "successful" post of the shipment most of the time.

Greg



-----Original Message-----
From: RPG400-L <rpg400-l-bounces-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org> On Behalf Of Martijn van Breden
Sent: Tuesday, February 24, 2026 4:38 AM
To: RPG programming on IBM i <[email protected]>
Subject: Re: Options for YAJLINTO to handle a null array

Hello Greg

We ran into this a while ago and experimented with null indicators and so on but that won't work.
You can use the countprefix keyword instead to handle this. It will be zero with an empty or null array.


Kind regards,

Martijn van Breden

lead software architect



--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.

Greg Wilburn
Director of IT
301.895.3792 ext. 1231
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.