Page 1 of 1

Help with DECIMAL HOST VARIABLE OR PARAMETER CONTAINS NON...

PostPosted: Fri Feb 10, 2017 2:54 am
by vicioprz
I'm trying to run a simple program which does a select to a table into their copy variables.

The sql is as follows:
EXEC SQL                                      
     SELECT NRO_DOCU,                        
            CUENTA_DOCU,                      
            BANCO_DOCU,                      
            SUC_DOCU,                        
            C_POST_DOCU,                      
            IMPORTE_DOCU,                    
            CHEQ_NRO_CUENTA,                  
       INTO
            :COEL12,              (PIC S9(9) COMP.)
            :COEL16,              (PIC S9(17) COMP-3.)
            :COEL13,              (PIC S9(4) COMP.)        
            :COEL14,              (PIC S9(4) COMP.)        
            :COEL15,              (PIC S9(6) COMP-3.)      
            :COEL17,              (PIC S9(9)V99 COMP-3.)    
            :CHEQ-NRO-CUENTA, PIC S9(16) USAGE COMP-3.)
       FROM TABLE1, TABLE2
      WHERE CHEQ_NRO_CHEQUE = :COEL12        
        AND CHEQ_BCO_EMIS   = :COEL13        
        AND CHEQ_SUC_EMIS   = :COEL14        
        AND CHEQ_COD_POSTAL = :COEL15        
        AND FECHA           = :WS-TODAY
END-EXEC.                                    
 

and I'm getting error:
SQLCODE:      000310-
DECIMAL HOST VARIABLE OR PARAMETER CONTAINS NON DECIMAL DATA.


I guess something's going on with the "into" part of the select. something related to reg IMPORTE_DOCU (PIC S9(9)V99 COMP-3) but i'm lost trying to solve it.

Can someone help me out please.

All variables are declared or belong to a copy.

Thanks.

edited by moderator

Re: Help with DECIMAL HOST VARIABLE OR PARAMETER CONTAINS NO

PostPosted: Fri Feb 10, 2017 6:07 am
by NicC
ppl?

What is the DDL for those columns? What is th COBOL definition? Can any of the columns be NULL?

As an aside, why are you selecting COEL12/13/14/15 when you already know their values?

Please use the code tags when posting code/data.