Passing a Binary Field to an RPGLE Program using CALL
0 pts.
0
Q:
Passing a Binary Field to an RPGLE Program using CALL
RPG
I need to pass a 9 digit Binary field (4 bytes in length) to an RPGLE program from a non-RPG program. Following shows how I coded in RPGLE.
* Parameter Fields
d pmbid ds
d mbid 9b 0
..
..
c *entry plist
c parm pmbid
..
..
When the Binary value is passed as the above parameter, the program doesn't convert it to the correct value.
I debugged the programs and found that the binary values sent by the calling program is converted to a different value by RPGLE. For your info. following are the values sent by non-RPG and received by RPGLE.

Sent Received by RPGLE
000000065 000000006
000000075 000000007
000001136 000000275
000001198 000000281
000001240 000000292

However, When I define this as either Packed or Zoned in both programs (Calling & Called) it works fine.

Please provide a solution as I must use passing field in Binary.

Thanks & Regards!
ASKED: Oct 20 2004  3:46 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
7785 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Go to MCPress and read Bob Cozzi article about binary fields.

It may be as simple as changing the spec from 9B to 10I 0

http://www.mcpressonline.com/mc?14@1.SETjcsjLb34.1@.6aecda48

============================================

I assume you're trying to use the 'B'inary data type because you aren't allowed to change the RPG program. (If you can change the RPG, there is no reason to use that data type since there are no decimal positions. Decimal positions would be the only reason to use it at all. It should be avoided.)

However, the first thing that comes to mind is a COBOL program that isn't properly synchronizing its data structures. It has a BINARY field in a data structure, and the structure isn't synchronized, so the positioning is off.

What language is calling the RPG? How is the field defined in that program? Any data structure should be shown.

Tom
Last Answered: Oct 18 2009  11:24 AM GMT by TomLiotta   7785 pts.
Latest Contributors: StuDog   0 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

RolandT   0 pts.  |   Oct 21 2004  7:27AM GMT

I’m not sure, but I think that you need to define the RPG field as 4B. Binary fields can only be numeric and don’t support number of decimals, so you don’t need to specify zero decimals.

 
0