• Subject: Re: QWCRSVAL API
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Wed, 27 Oct 99 07:55:39 +1000

Œ
Hello Andras,

This is an API that does indicate which parameter is in error.  According to 
the API manual:

   CPF1860 E Value &1 in list not valid.
   CPF1861 E Length of the receiver variable not valid.
   CPF1862 E Number of values to retrieve not valid.
   CPF24B4 E Severe error while addressing parameter list.
   CPF3CF1 E Error code parameter not valid.
   CPF3C19 E Error occurred with receiver variable specified.
   CPF3C90 E Literal value cannot be changed.
   CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.

The only list you provide is the array of system values so CPF1860 refers to 
PARM-4.  CPF1861 
refers to PARM-2.  CPF1862 refers to PARM-3.  CPF3CF1 refers to PARM-5.  
CPF3C19 refers to 
PARM-1.  The others are a little harder to deduce.

Your problem is "CPF1862 E Number of values to retrieve not valid." which 
suggests that the 
value for the 3rd parameter is incorrect.  The number in the 3rd parameter must 
be set by your 
program and must match the number of system value names in the array specified 
as the 4th 
parameter.

Assuming that you are actually setting the 3rd parameter correctly (not zero or 
negative) then 
the problem is likely the data type. Most API numeric fields are BIN(4) which 
means 4-bytes of 
storage representing a binary number.  RPGIV knows these as Integer data types, 
RPGIII/400 
struggles with fake Binary fields and will lose digits.  You must ensure the 
proper number of 
bytes is allocated.  An Integer defined with 1 to 5 digits will occupy 2 bytes, 
6 to 10 digits 
will occupy 4 bytes.  A fake Binary field defined as 2 bytes will hold a 
maximum value of 9999, 
4 bytes will hold a value of 999,999,999 which is significantly smaller than 
the values a real 
binary (integer) field can hold -- 32767 (2**15)-1 and 2,417,483,647 (2**31)-1 
when signed.

Some examples of what you need -- from memory so column alignment is incorrect:

In RPG IV:

D SysValCnt     S                       I  10 0 <====== 10 digits therefore 4 
bytes

In RPG III/400:
I       DS
I                               B  1  40    SVCNT       <=== 4 bytes therefore 
9 digits.

Boy, I must be feeling kind today!  Append code fragments if you still can't 
get it working.

Regards,
Simon Coulter.

«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software         AS/400 Technical Specialists       «»
«» Eclipse the competition - run your business on an IBM AS/400.  «»
«»                                                                «»
«» Phone: +61 3 9419 0175      Mobile: +61 0411 091 400           «»
«» Fax:   +61 3 9419 0175      mailto: shc@flybynight.com.au      «»
«»                                                                «»
«» Windoze should not be open at Warp speed.                      «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
//--- forwarded letter -------------------------------------------------------
> Date: Tue, 26 Oct 1999 07:31:32 -0700
> From: "Andrßs Cser" <cserandras@hotmail.com>
> To: MIDRANGE-L@midrange.com
> Reply-To: MIDRANGE-L@midrange.com
> Subject: QWCRSVAL API

> 
> I try to use the Retrieve System Values API from ILE RPG. But I receive 
> CPF1862, which means something is wrong with one of the parameters. I can't 
> see what is wrong.
> Can somebody show me the correct way of callind this API by an example 
> (prototypes, variable types, values etc)?
> 
> Thanks,
> 
> Andras Cser

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

This thread ...


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

This mailing list archive is Copyright 1997-2019 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 here. If you have questions about this, please contact [javascript protected email address].