title: JT400 error CPF3CF1 calling API QtocRtvTCPA in QTOCNETSTS.SRVPGM
body: <p>I am trying to call the API QtocRtvTCPA in /QSYS.LIB/QTOCNETSTS.SRVPGM in v7r3 via jtOpen/jt400.  parameter[3] is defined as ErrorCode in the API <br/>
  <a href="https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/apis/qtocrtvtcpa.htm" rel="nofollow noreferrer">https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/apis/qtocrtvtcpa.htm</a>
  <br/>  Every attempt I have made to call the service program has resulted in the error at the bottom.  I have tried all the items that are commented out below.  I could use some help in determining how to pass the error code parameter.</p>
  
  <pre><code>    private byte[] receiverVariable = new byte[1000];
  parameters[0].setOutputDataLength(receiverVariable.length);
      parameters[1].setInputData(bin4.toBytes(receiverVariable.length));
      parameters[2].setInputData(new AS400Text(8).toBytes("TCPA0200"));
      //parameters[3] = new ErrorCodeParameter();
      //parameters[3] = new ProgramParameter(BinaryConverter.intToByteArray(0));
      //parameters[3] = new ProgramParameter(new AS400Text(8).toBytes("ERRC0100"), 0);
      //parameters[3] = new ProgramParameter(new AS400Text(8).toBytes("ERRC0200"), 0);
      //parameters[3] = new ProgramParameter(0);
      ServiceProgramCall sPGMCall = new ServiceProgramCall(as400);
      sPGMCall.setProgram("/QSYS.LIB/QTOCNETSTS.SRVPGM", parameters);
      sPGMCall.setProcedureName("QtocRtvTCPA");
        sPGMCall.setReturnValueFormat(ServiceProgramCall.NO_RETURN_VALUE);
  </code></pre>
  
  <p>Error code parameter not valid.<br/>
  CPF3CF1<br/>
  AS400Message (ID: CPF3CF1 text: Error code parameter not valid.):com.ibm.as400.access.AS400Message@1536d79<br/>
  Cause . . . . . :   The format of the error code parameter is not correct. Recovery  . . . :   Correct the error code parameter and try the request again.  If you do not know the correct format for the error code parameter, see the APIs topic collection in the Programming category in the IBM i Information Center, <a href="http://www.ibm.com/systems/i/infocenter/" rel="nofollow noreferrer">http://www.ibm.com/systems/i/infocenter/</a>.</p>