Gleich noch eine SQL Frage (danke)

Das liefert eine 1 zurück (interaktiv, strsql)
Code:
with a as (select xxkey1, xxkey2, xxkey3                          
                    from xxfile where xxma = 14073              
                    and xxan = 0 and xxstat = 2)                
          select count(*) from(                                   
                          select yypool from yyfile               
                           where yyma=14073 AND yyAN=0        
                                 AND (yykey1, yykey2, yykey3) in( 
                             select xxkey1, xxkey2, xxkey3 from a)
                             and       yymk*1000+yymst <> 999997  
                              group by yypool) as v
ich brauche das als

Code:
C/exec-sql
C+ set :Z = (with a as (select xxkey1, xxkey2, xxkey3                          
C+                    from xxfile where xxma = 14073              
C+                    and xxan = 0 and xxstat = 2)                
C+          select count(*) from(                                   
C+                          select yypool from yyfile               
C+                           where yyma=14073 AND yyAN=0        
C+                                 AND (yykey1, yykey2, yykey3) in( 
C+                             select xxkey1, xxkey2, xxkey3 from a)
C+                             and       yymk*1000+yymst <> 999997  
C+                              group by yypool) as v   )
C/end exec
Das bricht zur Laufzeit ab und erzeugt sogar einen dump

Was ist falsch?

Danke