× 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.



You need to define type and description as part of data structure and define that field as an array. Something like:

dcl-ds Thing qualified template;
Type Char(2);
Description Char(25);
end-ds;

Dcl-pr WOMOrdTypR;
Envir Char(2);
Things_LENGTH int(10);
Things likeds(Thing) Dim(20);
Fail Char(100);
End-pr;

Dcl-pi WOMOrdTypR;
Envir Char(2);
Things_LENGTH int(10);
Things likeds(Thing) Dim(20);
Fail Char(100);
End-pi;

-----------------------------------------------
Nadir Amra
e-mail: amra@xxxxxxxxxx


From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> on behalf of (WalzCraft) Jerry Forss <JForss@xxxxxxxxxxxxx>
Date: Monday, May 12, 2025 at 7:54 AM
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] [WEB400] Web Service Return DS Array
Hi All

Cross posting to RPG list as well.

In my current pgm that is called from my Web Server I return arrays for each element.
I want to return a DS array instead.

Current Parameters

Dcl-pr WOMOrdTypR;
Envir Char(2);
Type Char(2) Dim(20);
Description Char(25) Dim(20);
Fail Char(100);
End-pr;

Dcl-pi WOMOrdTypR;
Envir Char(2);
Type Char(2) Dim(20);
Description Char(25) Dim(20);
Fail Char(100);
End-pi;

Which returns this from the service


{

"TYPE": [

"DS",

"EX",

"LT",

"NC",

"RM",

"RW",

"SL",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

""

],

"DESCRIPTION": [

"Drop Ship",

"Expedited Order",

"Literature Packed",

"No Charge",

"Remake",

"Re-Work",

"Standard Lead",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

""

],

"FAIL": ""

}


I want it to return

[
{
"TYPE": "DS",
"DESCRIPTION": "Drop Ship"
},
{
"TYPE": "EX",
"DESCRIPTION": "Expedited Order"
},
{
"TYPE": "LT",
"DESCRIPTION": "Literature Packed"
}
]


How do I define this as a DS so the service returns what I want?
I am looking for some good documentation on templates, I am assuming this is what I want but have never used it.



Subject to Change Notice:

WalzCraft reserves the right to improve designs, and to change specifications without notice.

Confidentiality Notice:

This message and any attachments may contain confidential and privileged information that is protected by law. The information contained herein is transmitted for the sole use of the intended recipient(s) and should "only" pertain to "WalzCraft" company matters. If you are not the intended recipient or designated agent of the recipient of such information, you are hereby notified that any use, dissemination, copying or retention of this email or the information contained herein is strictly prohibited and may subject you to penalties under federal and/or state law. If you received this email in error, please notify the sender immediately and permanently delete this email. Thank You

WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
www.walzcraft.com<http://www.walzcraft.com > Phone: 1-800-237-1326
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400 .

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-2025 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.