× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Sorry, I replied to soon on this.  I see that it thinks parameter 5 is 14
bytes long.  Press F1 on your CPF3C1D message and see who is sending the
message and from where to whom.  Perhaps TESTSRVPGM is calling some API and
that's where the problem is.  First step is to find out the line causing the
error message to be issued.

Gary 

> -----Original Message-----
> From: Gary L Peskin [mailto:garyp@xxxxxxxxxxxx] 
> Sent: Friday, December 17, 2004 8:04 AM
> To: 'Java Programming on and around the iSeries / AS400'
> Subject: RE: Paremeter Length errors. 
> 
> It looks like TESTSRVPGM wants pErrorId to be less than seven 
> bytes but it's seven bytes.  What is TESTSRVPGM expecting for 
> that argument?
> 
> Gary
> 
> > -----Original Message-----
> > From: java400-l-bounces@xxxxxxxxxxxx
> > [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of McNeal, John
> > Sent: Friday, December 17, 2004 7:16 AM
> > To: 'java400-l@xxxxxxxxxxxx'
> > Subject: Paremeter Length errors. 
> > 
> > I have a Java class calling a service program with several 
> parameters.  
> > I keep getting this error on one of the parameters:
> > 
> >  
> > 
> > Message ID . . . . . . :   CPF3C1D       Severity . . . . . 
> . . :   30
> > 
> > Message type . . . . . :   Escape
> > 
> > Date sent  . . . . . . :   04/12/17      Time sent  . . . . . 
> > . :   10:10:58
> > 
> >  
> > 
> > Message . . . . :   Length specified in parameter 5 not valid.
> > 
> > Cause . . . . . :   The length of 14 for parameter 5 is not 
> > valid.  Values
> > for
> > 
> >   this parameter must be greater than 0 and less than 7.
> > 
> > Recovery  . . . :   Correct the length and call the API again.
> > 
> >  
> > 
> >  
> > 
> > It is defined as
> > 
> >             AS400Text pMsgPgm = new AS400Text(10, system);
> > 
> >  
> > 
> >             
> > 
> >             AS400Text pFunction  = new AS400Text(1, system);
> > 
> >             
> > 
> >       AS400Text pUserId  = new AS400Text(10, system);
> > 
> >       
> > 
> >       AS400Text pErrorFld  = new AS400Text(10, system);
> > 
> >       
> > 
> >       AS400Text pErrorId  = new AS400Text(7, system);
> > 
> >       
> > 
> >       AS400Text pRetCd  = new AS400Text(1, system);
> > 
> >  
> > 
> > String MsgPgm = "          "; 
> > 
> >       String Function = "E";
> > 
> >       String UserId = "MCNEALJO";
> > 
> >       String ErrorFld = "          ";
> > 
> >       String ErrorId = "XXXXXXX";
> > 
> >       String RetCd = " ";
> > 
> >  
> > 
> >             parms[0] = new 
> ProgramParameter(pMsgPgm.toBytes(MsgPgm));
> > 
> >             
> > 
> >             parms[1] = new
> > ProgramParameter(pFunction.toBytes(Function));
> > 
> >             
> > 
> >             parms[2] = new 
> ProgramParameter(pUserId.toBytes(UserId));
> > 
> >             
> > 
> >             parms[3] = new
> > ProgramParameter(pErrorFld.toBytes(ErrorFld));
> > 
> >             
> > 
> >             parms[4] = new
> > ProgramParameter(pErrorId.toBytes(ErrorId));
> > 
> >             
> > 
> >             parms[5] = new ProgramParameter(pRetCd.toBytes(RetCd));
> > 
> >             
> > 
> >  
> > 
> >             ServiceProgramCall sPGMCall = null;
> > 
> >  
> > 
> >             System.out.println("About to create the program");
> > 
> >             sPGMCall =  new ServiceProgramCall(system,
> > 
> >  
> > "/QSYS.LIB/MCNEALJO.LIB/TESTSRVPGM.SRVPGM",parms);
> > 
> >             sPGMCall.setProcedureName("TESTSRVPGM");
> > 
> >             System.out.println(sPGMCall.run());
> > 
> >  
> > 
> >             AS400Message[] ml = sPGMCall.getMessageList();
> > 
> >  
> > 
> >             for (int i=0; i<ml.length; i++)
> > 
> >                System.out.println(ml[i].getID() + ": " + 
> > ml[i].getText());
> > 
> >             }
> > 
> >             catch (Exception e){
> > 
> >                   System.out.println(e);
> > 
> >             }
> > 
> >  
> > 
> > Any idea why this message ?  I don't see a field that is 14 
> bytes long 
> > anywhere.
> > 
> >  
> > 
> >  
> > 
> > John McNeal
> > 
> > CARE Development
> > 
> > 678-893-1739
> 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.