|
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
mgarton@xxxxxxxxxxxxxxx
Sent: Thursday, June 07, 2007 10:17 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Service Program using a C module
I have a program that format messages. Currently the
formatting process is all in one program that uses a C
module. Since the formatting can be used by other processes,
I want to make a formatting service program with a
module for each message type. The C module would be used
within all the
modules. I am getting multiple definition errors when trying
to create the service program. Below is how the C module is
described/used in the existing program.
DToBCD PR
D 18P 0
DFromBCD PR
D 10
D BCDPacked S 18P 0 EXPORT
D BCDChar S 10 EXPORT
C CALLP ToBCD(BCDPacked)
Here is how the service program modules look:
/Copy *LIBL/QCPYSRC,PCS_Format (contains prototypes just as above)
D BCDPacked s 18P 0 Export
D BCDChar s 10 Export
P FMT0100 B Export
D FMT0100 PI 256A
D InputVar 264A Const
C CALLP ToBCD(BCDPacked)
P E
This is my first attempt at creating a service program from
scratch. How
should the variables BCDPacked and BCDChar be described?
The above works
when I have the one module but when I start adding other
modules I get a multiple definition error when I try to
create service program. So that means that the variables are
global when described as above? Is there a better way to do this?
Thanks.
Mark Garton
Information Systems
O'Reilly Auto Parts
--
This is the RPG programming on the AS400 / iSeries (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.