Skip to content

Commit dab26ee

Browse files
committed
- ensure <param> tag contains the 'by' attribute for val/ref.
- it was previously being passed in the <data> attribute. - this is similar to how the 'io' attribute is handled. - this allows service programs procedures that use the VALUE keyword to work with node Signed-off-by: Dave Weissman <weissmad@gmail.com>
1 parent 89be160 commit dab26ee

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

lib/itoolkit.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,9 @@ class iPgm {
347347
opt = type;
348348
else
349349
opt = options;
350+
350351
if(!inDs) { // In recursive mode, if it is an element in DS, then no <parm> or </parm> needed.
351-
if(opt && opt.io)
352-
this.xml += i_xml.iXmlNodeParmOpen(opt.io);
353-
else
354-
this.xml += i_xml.iXmlNodeParmOpen();
352+
this.xml += i_xml.iXmlNodeParmOpen(opt);
355353
}
356354
if(__getClass(data) == "Array") { // If it is a struct parameter, recursivly parse its children.
357355
if(opt)

lib/ixml.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ const I_XML_ATTR_KEY_DB = "db";
107107
const I_XML_ATTR_KEY_USERID = "uid";
108108
const I_XML_ATTR_KEY_PASSWORD = "pwd";
109109
const I_XML_ATTR_KEY_IO = "io";
110+
const I_XML_ATTR_KEY_BY = "by";
110111
const I_XML_ATTR_VALUE_IO = "both";
111112
const I_XML_ATTR_KEY_OFFSET = "offset";
112113
const I_XML_ATTR_KEY_TOP = "top";
@@ -173,9 +174,21 @@ const iXmlNodePgmClose = () => {
173174
return I_XML_NODE_PGM_CLOSE;
174175
}
175176

176-
const iXmlNodeParmOpen = (xio) => {
177+
const iXmlNodeParmOpen = (opt) => {
178+
if (!(opt && typeof opt==='object')){
179+
return iXmlNodeOpen(I_XML_NODE_PARM_OPEN)
180+
+ I_XML_NODE_CLOSE;
181+
}
182+
183+
let opt_io=(opt.io) ? iXmlAttrDefault(I_XML_ATTR_KEY_IO,opt.io,I_XML_ATTR_VALUE_OPTIONAL) : "";
184+
let opt_by=(opt.by) ? iXmlAttrDefault(I_XML_ATTR_KEY_BY,opt.by,I_XML_ATTR_VALUE_OPTIONAL) : "";
185+
186+
delete opt.by;
187+
delete opt.io;
188+
177189
return iXmlNodeOpen(I_XML_NODE_PARM_OPEN)
178-
+ iXmlAttrDefault(I_XML_ATTR_KEY_IO,xio,I_XML_ATTR_VALUE_OPTIONAL)
190+
+ opt_io
191+
+ opt_by
179192
+ I_XML_NODE_CLOSE;
180193
}
181194

0 commit comments

Comments
 (0)