I am using PCML to call C/400 Program from my Java program.
The C Program gets 2 arguments in the main's argv[] argument , and set the processed value back into argv[1].
When I run my java program and send the excepted arguments, the C program is executed but I can not get the returned value.
I set the usage in the PCML file to be inputoutput.
Is there a way to get the value that set back in argv[1] ?
Regards,
Tomer S.
Attached the C Progam, the PCML file and the Java Program
The C Program:
void main(int argc,char *argv[]) {
// Geting 3 string values as arguments in argv[]
// and return a processed string in argv[1]
{
// Call the Program
System.out.println("Calling the program...");
rc = pcml.callProgram(programName);
// If return code is false, get messages from the iSeries
if (rc == false) {
String msgId, msgText;
// Retrieve list of AS/400 messages
AS400Message[] msgs = pcml.getMessageList(programName);
// Loop through all messages and write them to standard output
for (int m = 0; m < msgs.length; m++) {
msgId = msgs[m].getID();
msgText = msgs[m].getText();
System.out.println(" " + msgId + " - " + msgText);
}
System.out.println("Call to TEST failed. See messages listed above");
System.exit(0);
}
// Return code was true, call to PROGRAM succeeded - woo-hoo!
else {
// Process the returned Data
valueStr = (String) pcml.getValue("myCProg.argv");
System.out.println("------------------------ After Executing ---------------------------");
System.out.println("InputParameters: valueStr: " + valueStr);
System.out.println("--------------------------------------------------------------------");
System.exit(0);
}
} catch (PcmlException e) {
System.out.println(e.getLocalizedMessage());
e.printStackTrace();
System.out.println("Call to PROGRAM failed");
System.exit(0);
}
}
As an Amazon Associate we earn from qualifying purchases.
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.