× 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.



How do you bind the module to the other source?
-----Original Message-----
Message: 3
Subject: Re: Calling Program with a Procedure Interface
To: rpg400-l@midrange.com
From: MWalter@hanoverwire.com
Date: Thu, 4 Apr 2002 13:30:42 -0500
Reply-To: rpg400-l@midrange.com


Your procedure interface is not within a procedure. You stated in your
previous post that you compiled as a program with DFTACTGRP(*YES). If you
indeed want to use this code as a procedure, you need to code a Prototype
that basically looks just like your PI. Then place a P spec before your PI
to begin your procedure and a closing P spec after your last line of code.
You will also need the NOMAIN keyword in your Header Spec. Then compile the
source as a *MODULE using  the CRTRPGMOD command. Then bind this module to
your other source.

hoptions(*srcstmt) NOMAIN
fqprint    o    f  132        printer
  * this is the procedure prototype, it defines the interface
Dnextelreceive    pr
D ptype                          8
D pdot                           3
D pdpro                          8
D pdpo                          20
D pdconsignee                   30
D pdconaddress1                 30
D pdconaddress2                 30
D pdcity                        20
D pdstate                        2
D pdzipcode                      6
D pdhu                           5
D pdpieces                       5
D pdweight                       7
D pdstatus                      10
D pdreceivedby                  30
D ppconfirmation                10
D ppshipper                     30
D ppshipaddress1                30
D ppshipaddress2                30
D ppshipcity                    30
D ppshipstate                    2
D ppshipzipcode                  6
D ppweight                       7
D pppieces                       5
D ppkgcode                       2
D ppdestcity                    30
D ppdeststate                    2
D ppdestzipcode                  6
D pppronumber                   11

   * this starts the procedure
Pnextelreceive                  B
EXPORT
Dnextelreceive    pi
D ptype                          8
D pdot                           3
D pdpro                          8
D pdpo                          20
D pdconsignee                   30
D pdconaddress1                 30
D pdconaddress2                 30
D pdcity                        20
D pdstate                        2
D pdzipcode                      6
D pdhu                           5
D pdpieces                       5
D pdweight                       7
D pdstatus                      10
D pdreceivedby                  30
D ppconfirmation                10
D ppshipper                     30
D ppshipaddress1                30
D ppshipaddress2                30
D ppshipcity                    30
D ppshipstate                    2
D ppshipzipcode                  6
D ppweight                       7
D pppieces                       5
D ppkgcode                       2
D ppdestcity                    30
D ppdeststate                    2
D ppdestzipcode                  6
D pppronumber                   11

dwkpro            ds
d #ot                     1      3  0
d #pro                    4     11  0
ddelvline         s            132
ddelvline1        s            132

c                   select
c                   when      ptype = 'Delivery'
c                   exsr      procesdelivery
c                   when      ptype = 'Pickup'
c                   exsr      procespickup
c                   endsl

c                   eval      *inlr = *on
c                   return
c**********************************************************************
c* Process Delivery Detail sent back from Nextel Phones.
c**********************************************************************
c     procesdeliverybegsr

c                   clear                   delvline
c                   eval      delvline = 'Type: Delivery' + '   ' +
c                                        'Pro Number: ' + ' ' +
c                                         %trim(pdot) +
c                                        ' ' +
c                                        %trim(pdpro) +
c                                        '   ' +
c                                        'Consignee: ' + ' ' +
c                                        (pdconsignee) +
c                                        '   ' +
c                                        'Address: ' + ' ' +
c                                        (pdconaddress1) +
 c                                        '   ' +
 c                                        'Address: ' + ' ' +
 c                                        (pdconaddress2)
 c                   eval      delvline1 =
 c                                        'City: ' + ' ' +
 c                                        (pdcity) +
 c                                        '   ' +
 c                                        'State: ' + ' ' +
 c                                        %trim(pdstate) +
 c                                        '   ' +
 c                                        'Zip: ' + ' ' +
 c                                        %trim(pdzipcode) +
 c                                        '   ' +
 c                                        'HU: ' + ' ' +
 c                                        %trim(pdhu) +
 c                                        '   ' +
 c                                        'Pieces: ' + ' ' +
 c                                          %trim(pdpieces) +
 c                                        '   ' +
 c                                        'Weight: ' + ' ' +
 c                                          %trim(pdweight) +
 c                                        '   ' +
 c                                        'Status: ' + %trim(pdstatus) +
 c                                        '   ' +
 c                                        'Received by: '  + ' ' +
 c                                         %trim(pdreceivedby)

 c                   except    dline
 c                   except    dline1

 c                   endsr
 c**********************************************************************
 c* Process pickup Detail sent back from Nextel Phones.
 c******************************************************************
 c     procespickup  begsr

 c                   clear                   delvline
 c                   eval      delvline = 'Type: Delivery' + '   ' +
 c                                        'Pro Number: ' + ' ' +
 c                                        ' ' +
 c                                        %trim(pdpro) +
 c                                        '   ' +
 c                                        'Consignee: ' + ' ' +
 c                                        (pdconsignee) +
 c                                        '   ' +
 c                                        'Address: ' + ' ' +
 c                                        (pdconaddress1) +
 c                                        '   ' +
 c                                        'Address: ' + ' ' +
 c                                        (pdconaddress2)
 c                   eval      delvline1 =
 c                                        'City: ' + ' ' +
 c                                        (pdcity) +
 c                                        '   ' +
 c                                        'State: ' + ' ' +
 c                                        %trim(pdstate) +
 c                                        '   ' +
 c                                        'Zip: ' + ' ' +
 c                                        %trim(pdzipcode) +
 c                                        '   ' +
 c                                        'HU: ' + ' ' +
 c                                        %trim(pdhu) +
 c                                        '   ' +
 c                                        'Pieces: ' + ' ' +
 c                                          %trim(pdpieces) +
 c                                        '   ' +
 c                                        '   ' +
 c                                        'Weight: ' + ' ' +
 c                                          %trim(pdweight) +
 c                                        '   ' +
 c                                        'Status: ' + %trim(pdstatus) +
 c                                        '   ' +
 c                                        'Received by: '  + ' ' +
 c                                         %trim(pdreceivedby)

 c                   endsr
 oqprint    E            dline
 o                       delvline           132
 oqprint    E            dline1
 o                       delvline1          132
  * this ends the procedure.
  P                            E

Thanks,

Mark


Mark Walter
Sr. Programmer/Analyst
Hanover Wire Cloth a div of CCX, Inc.
mwalter@hanoverwire.com
http://www.hanoverwire.com
717.637.3795 Ext.3040




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.