title: iSeries stored procedure calling RPG program doesn't return a value to the program
body: <p>I have a stored procedure that calls an SQLRPGLE program. The program is running fine as I have verified in the debugger and sends the return value as expected. Instead what is returned when looking at <code>cmd.Parameters["@ISMATCH"].Value = {}</code>. I am guessing I am doing something wrong. What could it be?</p>
  
  <p>The stored procedure:</p>
  
  <pre><code>CREATE PROCEDURE "MPRLIB"."CHECKHOURS" (EMPLOYEEID DECIMAL(10 , 0), 
      INOUT ISMATCH CHAR(1))
  LANGUAGE RPGLE
  PARAMETER STYLE SQL
  NOT DETERMINISTIC
  MODIFIES SQL DATA 
  SPECIFIC CHECKHOURS 
  NEW SAVEPOINT LEVEL
  EXTERNAL NAME 'MPRLIB/MPRLRCHK';
  </code></pre>
  
  <p>My method:</p>
  
  <pre><code>    public bool IsValidTimesheet(int id)
      {
          bool isValid = false;
  
          // Get the data from the iSeries
          using (iDB2Connection conn = new iDB2Connection(ConfigurationManager.ConnectionStrings["IbmIConnectionString"].ConnectionString))
          {
              using (iDB2Command cmd = conn.CreateCommand())
              {
                  cmd.CommandType = CommandType.StoredProcedure;
                  cmd.CommandText = "LIB.CHECKHOURS";
  
                  cmd.Parameters.Add("@EMPLOYEEID", iDB2DbType.iDB2Decimal).Value = id;
                  cmd.Parameters.Add("@ISMATCH", iDB2DbType.iDB2Char).Direction = ParameterDirection.Output;
                  conn.Open();
                  cmd.ExecuteNonQuery();
                  isValid = (cmd.Parameters["@ISMATCH"].Value.ToString() == "1") ? true : false;
                  conn.Close();
              }
          }
  
          return isValid;
      }
  </code></pre>
  
  <p>My RPG program parameters:</p>
  
  <pre><code> D CHECKHOURS      PR                  extpgm('CHECKHOURS')
   D  id                           10P 0
   D  isMatch                       1A
  </code></pre>