import com.ibm.as400.micro.ProgramCall; import com.ibm.as400.micro.MEException; import com.ibm.as400.micro.AS400; // more imports in actual source code public class PgmGetSysStatus extends CallProgram { // we will leave out the constructors and super calls, just take it for given that an AS400 object is in // place and has the appropriate scope and has the name "system" public String[] run(String[] parm) { String pcmlName = "QWCRSSTS.pcml"; // The PCML document we want to use. String apiName = "qwcrssts"; Hashtable parametersToSet = new Hashtable(); parametersToSet.put("qwcrssts.receiverLength", "2048"); String[] parametersToGet = {"qwcrssts.receiver.systemName", "qwcrssts.receiver.usersCurrentlySignedOn", "qwcrssts.receiver.batchJobsRunning", "qwcrssts.receiver.batchJobsEndedWithPrtOutWait"}; String[] valuesToGet = null; try { valuesToGet = ProgramCall.run(system, pcmlName, apiName, parametersToSet, parametersToGet); return valuesToGet; } catch (IOException e) { return null; } catch (MEException e) { return null; } finally { system.disconnect(); } } }