Question

01) I was trying to get IBM/AS400 Serial no using command call method. code is working coz it's nothing given any error or exception. i thing there is something missing. help me to correct it.

02) is there is any way to get AS/400 serial no using jt400 (java). i found getSerialNum() method. but com.ibm.cics.server.CertificateInfo import is give exception. also help me to correct it (if anyone can tell me how to get serial no using getSerialNum() method it's really helpful for me)

Thank in advance!

My command call 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);
Was it helpful?

Solution

Have a look at the SystemValue class.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top