One Star

Java exception in talend job calling ISeries CL code

Hi,
I have an Exception when Talend Job try to call this Iseries (As400) CL (control language). Can someone help me to figure out the problem ?
My talend code in tjavaflex
ProgramParameter[] parameterList = new ProgramParameter;
if (connectAS400 == null) {connectAS400 = new asutils(context.ip_machine, "talend", "tld2011");}
// 1ier paramettre Code Société
AS400PackedDecimal coSoc = new AS400PackedDecimal(4,0);
parameterList   = new ProgramParameter(coSoc.toBytes(context.societe), 3);
// 2nd paramettre Code enseigne
AS400PackedDecimal coEns = new AS400PackedDecimal(3,0);
parameterList   = new ProgramParameter(coEns.toBytes(context.enseigne), 2);
// 3ime paramettre code Stock   
AS400Text noart    = new AS400Text(17);
parameterList   = new ProgramParameter(noart.toBytes(out1.CCTREF), 20);
// 4iem Parametre Disponibilité
AS400PackedDecimal enComArt = new AS400PackedDecimal(13,3);
parameterList   = new ProgramParameter(enComArt.toBytes(new BigDecimal("0")), 7);
// 5iem Parametre Disponibilité
AS400PackedDecimal dispoArt = new AS400PackedDecimal(10,3);
parameterList   = new ProgramParameter(dispoArt.toBytes(new BigDecimal("0")), 8);
// Appel programme             
connectAS400.appelpgm(parameterList, "HHHPGM", "DISPCDFCL");
out.Qte_en_com=(BigDecimal)enComArt.toObject(parameterList.getOutputData());
out.Qte_en_stock=(BigDecimal)dispoArt.toObject(parameterList.getOutputData());
out.Reference=out1.CCTREF;
out.Qte_cumul=out1.CCTQTE;
out.nombre_X=out1.nombre;
out.Libelle=out1.ARTLIB;
out.Code_stock=out1.ARTRA1;
My Iseries (As400) code
pgm (&stgrp &stdos &artno &encom &dispo)                          
                                                                  
             DCL        VAR(&STGRP)    TYPE(*DEC)  LEN(4 0)         
             DCL        VAR(&STDOS)   TYPE(*DEC)  LEN(3 0)         
             DCL        VAR(&ARTNO)   TYPE(*CHAR) LEN(17)          
             DCL        VAR(&encom)   TYPE(*DEC)  LEN(13 3)        
             DCL        VAR(&DISPO)    TYPE(*DEC)  LEN(10 3)        
                                                                  
   CALL  PGM(HHCUMSTK) PARM(&stgrp &stdos &artno &dispo)   
   CALL  PGM(SCCALCDF) PARM(&stgrp &stdos &artno &encom)   
endpgm                                                            
Java Exception
Exception in component tJavaFlex_1
java.lang.NumberFormatException: Low-order nibble of the byte at array offset 5 is not valid.  Byte value: 0F.
    at com.ibm.as400.access.AS400PackedDecimal.throwNumberFormatException(AS400PackedDecimal.java:584)
    at com.ibm.as400.access.AS400PackedDecimal.toObject(AS400PackedDecimal.java:556)
    at com.ibm.as400.access.AS400PackedDecimal.toObject(AS400PackedDecimal.java:495)
    at serviceweb.creer_et_distribuer_fichier_vm_0_1.creer_et_distribuer_fichier_VM.tAS400Input_1Process(creer_et_distribuer_fichier_VM.java:7212)
    at serviceweb.creer_et_distribuer_fichier_vm_0_1.creer_et_distribuer_fichier_VM.tFixedFlowInput_1Process(creer_et_distribuer_fichier_VM.java:918)
    at serviceweb.creer_et_distribuer_fichier_vm_0_1.creer_et_distribuer_fichier_VM.runJobInTOS(creer_et_distribuer_fichier_VM.java:9267)
    at serviceweb.creer_et_distribuer_fichier_vm_0_1.creer_et_distribuer_fichier_VM.main(creer_et_distribuer_fichier_VM.java:9095)
1 REPLY
Community Manager

Re: Java exception in talend job calling ISeries CL code

Hi
Debug the generated code to see which line cause the exception, perhaps this article can provide some clues. 
----------------------------------------------------------
Talend | Data Agility for Modern Business