I was just about to post this but I see you've worked it out.

I am assuming a copy/paste error because you need Qualified on the top level DS.

Just as a matter of form I would suggest changing the name of the outer DS having the name student repeated is a bit confusing. Maybe Students (plural) for the outer DS?


Jon P.

On Jun 29, 2022, at 4:02 PM, Suren K <suren7437@xxxxxxxxx> wrote:

Hi All,

Found the solution

We need to define the Data structure like below and using DATA-GEN I am
able to achieve this

dcl-ds Student;
num_student int(10);
dcl-ds student dim(9);
studentName char(100);
studentJoiningDate char(10);
num_studentSubject int(10);
studentSubject char(10) dim(9);
end-ds;
end-ds;

Regards,
Suren

On Wed, Jun 29, 2022 at 9:31 AM Suren K <suren7437@xxxxxxxxx> wrote:

Hi All,

Currently I am using DATA-INTO and DATA-GEN for parsing/generating JSON
document. Also I am using YAJL Parser and Generator as well.

Now I have a tricky JSON requirement which I am not sure whether I can
achieve using DAT-GEN. The sample JSON data is below

{
"student": [
{
"studentName": "John",
"studentJoiningDate": "2010-08-29",
"studentSubject": [
"Science",
"Maths",
"Social",
"ComputerScience"
]
}
]
}

Is it possible to generate a JSON Array without field names like
studentSubject?

Any help/suggestions will be very much appreciated.

Regards,
Suren

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

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.