• Subject: Sv: Numeric parameters between RPG programs
  • From: "Henrik Krebs" <Henrik.Krebs@xxxxxxxxx>
  • Date: Wed, 27 May 1998 23:13:57 +0200

No PTF's are needed - just a matter of understanding.

A 'parameter' is nothing than a pointer to a place, where a value is stored.
The 'parameter' itself has no type.

A numeric variable can be signed or packed (lets forget binary - it's not the
case here) (In a CLP and from a command it's always packed). 

A file-field does NOT exist in a program. The program recieves only a record
into a buffer. The program then moves it into a program field. The compiler is
intelligent enough to include a packed-to-signed conversion or reverse if
needed. During the compilation the program-field will inheret some attributes
from the file-field, but not neccecary all.

The simplest way to determine the format of a program field is to look in the
compilation list, but of cause there are rules: DS-fields are normally signed
unless specificly defined 'P'. Internally defined fields are normally packed.

It's YOUR responsability that the variable used for parameters corresponds in
calling and called program.


Regards

Henrik Krebs

------------------------------------------------------------
Henrik Krebs
IT Consultant (IBM AS/400)
Phone +45 31 57 83 23
Mobile +45 40 88 83 23
Email: Henrik.Krebs@Scout.Net
Web: http://users.cybercity.dk/~dko3534
Snailmail: Amagerbrogade 62, 3-24, DK-2300 Copenhagen
------------------------------------------------------------

----------
Fra: M Elena Vzquez <maena@correo.com>
Til: MIDRANGE List <MIDRANGE-L@midrange.com>
Emne: Numeric parameters between RPG programs
Dato: 27. maj 1998 21:06

Good morning,
I have a problem in an RPG program, and I would like to know whether
exists a PTF to solve it or it is the correct behaviour.

In program 1 I have defined  a list of parameters to call to program 2,
one of these parameters in program 1 corresponds to a field from a
external described file, and its type is zoned (5S 0).
When I call the second program, it receives this parameter into a
program variable defined in D specs with the same type (5S 0), but the
contents of this variable is always garbage, and I receive a run-time
error in the first line that uses the variable.

I've noticed that including the field into a data structure in the first
program (without redefine it), or moving the field to a program defined
variable, the second program receives the value correctly.

So, I don't know if RPG doesn't support numeric fields as parameters
(although it seems that numeric program defined variables does), or a
type of 5S 0 in DDS is different to a 5S 0 in RPG, or I need to load a
PTF, or what. So, please I would appreciate any help to solve this
problem (of course, I don't want to move this field to a variable, or
create data structures just to avoid the problem)

I'm in V4R1, and it is an ILE program.

Thank you very much.
----------------------------------------------
M Elena Vzquez
mailto:maena@correo.com
----------------------------------------------



+---
| 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 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 on our policy page. If you have questions about this, please contact [javascript protected email address].