× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi everyone.

I've got this curious case. I had to look into Scott's documentation on
DATA-GEN, and tried to apply what's in there. But it is not working. Sure
this may be my mistake, and I would like and appreciate your comments, as
usual.

The following resembles my original code and should be helpful and easy to
understand.

I've got this DS:

dcl-ds myRequest qualified inz;
subfield1 char(10),
subfield2 char(20);
subfield3 char(30);
end-ds;

dcl-s myJsonRequest char(1024) inz;

I need DATA-GEN to put in myJsonRequest the following:

{"myRequest" : {
"subfield1" : "contents of subfield1",
"subfield2" : "contents of subfield2",
"subfield3" : "contents of subfield3"
}
}

When i invoke DATA-GEN with no options, I am getting this:

{
"subfield1" : "contents of subfield1",
"subfield2" : "contents of subfield2",
"subfield3" : "contents of subfield3"
}

I was expecting the json object to inherit the "myRequest" name.
Reading on Scott's documentation on DATA-GEN, he states that I can include
in the options for %DATA, 'name=myRequest" as I wrote above, and with that,
it would produce the desired json output, but it is not doing it.

Please, what am I doing wrong?

TIA

Javier.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.