AS / 400 Command Call - JT400 (Java)

01) I tried to get the IBM / AS400 Serial without using the command invocation method. the code works because nothing gives any error or exception. I can not see anything. help me fix this.

02) is there a way to get the AS / 400 serial number without using jt400 (java). I found a method getSerialNum(). but com.ibm.cics.server.CertificateInfoimport provides an exception. also help me fix it (if someone tells me how to get the serial number without using the method getSerialNum(), this is really useful for me)

Thanks in advance!

My team code:

AS400 system = new AS400();
CommandCall command = new CommandCall(system);
try
{
    // Run the command "DSPSYSVAL" and parameter value for "SYSVAL" is "QSRLNBR"
    if (command.run("DSPSYSVAL QSRLNBR") != true)
    {
        // Note that there was an error.
        System.out.println("Command failed!");
    }else{

           // Show the messages (returned whether or not there was an error.)
    AS400Message[] messagelist = command.getMessageList();
    for (int i = 0; i < messagelist.length; ++i)
    {
        // Show each message.
        System.out.println(messagelist[i].getText());
    }

    }

}
catch (Exception e)
{
    System.out.println("Command " + command.getCommand() + " issued an exception!");
    e.printStackTrace();
}
// Done with the system.
System.out.println("End!");
system.disconnectService(AS400.COMMAND);
+4
source share
1 answer
+5

All Articles