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



I'm still working on this, but I wanted to get it on the list ASAP,
because I asked a question about it yesterday, and there's no need for
anybody to waste time on the issue. Thanks Mark for your comments on this.

Apparently passing a string as an argument to QCMDEXC doesn't work
because EGL doesn't generate code to remove the string length. It can't,
because there is no prototype for the argument, so EGL has no way of
knowing what's needed. Since the maximum EGL string length is 32767, I'm
guessing the length is in the first two bytes at the variable address,
just like the i. I'm not sure if that's because the string uses a double
byte character set, or if it's because the length is signed. I suspect
the former. I also suspect that a literal string is not a string at all,
but rather is stored as an array of char, since it has no need for a
length descriptor. For that reason, a literal can be passed directly to
QCMDEXC without error. However (and I'm really guessing here) passing a
literal value will not work if the argument is expected to be a variable
length string on the i.

What does work when a string value needs to be passed to QCMDEXC, is
assigning the string value to an array of char. This does appear to
remove the string length information. Since QCMDEXC is passed the length
of the command argument, the array can be defined at any arbitrary
length, as long as it is wide enough to contain the value in the command
string. It could probably even be passed the size (in char's) of the
array of char, because the command parser on the i ignores trailing blanks.

Here's the source that does work:
--------------
package com.vcpi.services;

// service
service submit
// Variable Declarations
cmdString string;
cmdArg char(64);
cmdLength decimal(15,5);
returnVal string;

// Function Declarations
function submit(payor string in) returns(string)
syslib.setRemoteUser("xxxxx", "xxxxx");
cmdString = "SBMJOB CMD(AR8350 PAYOR(" + payor + "))";
cmdArg = cmdString;
cmdLength = strlib.characterLen(cmdString);
returnVal = "Submitted batch for " + payor;
try
call "COMMANDONI" (cmdArg, cmdLength);
onException (ex AnyException)
returnVal = CmdString + " (" + cmdLength + ")" + " Batch submission
failed for " + payor + ". " + ex.messageID + " " + ex.message;
end
return(returnVal);
end
end
--------------

Now I just need to make it work when fully deployed to tomcat.


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.