title: DB2 count(*) over(partition by fieldname) giving -104 z/OS version 7
body: <p>I have slimmed down the query to remove potential complications, in addition I have verified that the fields are correct. DB2 UDB zSeries V7 is my db2 version.</p>
  
  <pre><code>SELECT 
      STDINSTRCD, 
      COUNT(*) OVER(PARTITION BY STDINSTRCD),
      CAST(STDINSTRDESC AS VARCHAR(1000)) AS INSTR,
      C.STDINSTRSEQ,
      1
  FROM 
      SYST.SCC004 C
  WHERE  
      C.STDINSTRCD = '098'
  </code></pre>
  
  <p>I have tried a subquery as well.</p>
  
  <pre><code>select 
   H2.FRSTSTDINSTRCD,
   (select count(*) from SYST.scC004 Ci where '098'=Ci.STDINSTRCD) as cnt, 
   cast(STDINSTRDESC as varchar(1000)),
   C.STDINSTRSEQ,
   1
  from SYST.scE4A00 H2
   LEFT OUTER JOIN SYST.scC004 C
   ON C.STDINSTRCD = H2.FRSTSTDINSTRCD
   WHERE
    H2.CTLENTYID='MCS'
    AND H2.VCKVAL='12654'
    AND H2.POKVAL='0198617S12 000  000'
  </code></pre>
  
  <p>The error is receive is om.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: (;, FROM INTO <a href="http://en.wikibooks.org/wiki/SQL_return_codes" rel="nofollow noreferrer">sqlcode</a> <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0sttmsg.htm" rel="nofollow noreferrer">sqlstate</a>
  -104 Illegal Symbol token.
  42601 A character, token, or clause is invalid or missing.</p>
  
  <p>Any advice? I have been unable to determine what syntax error I might me making.</p>