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


  • Subject: RE: Passing Parms to an RPG Program
  • From: "Silvio Santos" <Silvio.Santos@xxxxxxxxxxx>
  • Date: Thu, 23 Mar 2000 14:31:14 +0000



Hi!
I think this previous answer from who knows will help you....

Silvio.

---------------------- Forwarded by Silvio Santos/VC/PT/BRAIN on 03/23/2000
02:28 PM ---------------------------


Buck Calabro <buck.calabro@aptissoftware.com> on 01/19/2000 08:42:03 PM

Please respond to RPG400-L@midrange.com

To:   RPG400-L@midrange.com
cc:    (bcc: Silvio Santos/VC/PT/BRAIN)

Subject:  RE: Entry Parameters




Jim,
The command line has no explicit declarations for literals; the default
declarations are numeric=Packed(15 5) and character=Char(32).  This means
that calling this program from the command line will result in the following
operations:

1. Read literal 51
2. Create a work area 8 bytes long (to hold 15 packed digits)
x'000000000000000f'
3. Decimal align the literal within the packed field x'000000005100000f'
4. Pass the address of this work area to the called program.
5. Called program gets address of work area
6. Called program interprets data in work area according to the explicit
definition of the field (Signed 2/0) x'0000'
7. Called program gets decimal data error because field contents are not a
valid number

You do not have to pass them as character strings if you are calling from
another program (because the caller will have the same data size/type
declaration as the caller.)  If you call this from the command line (for
testing reasons) you can specify the parameters in hex mode:
CALL PGM(JIMCONEX/CHGAPOPEN) PARM(x'5f1f' x'9f9f0f1f1f0f' x'5f1f'
x'0f0f0f1f2f0f')

If you routinely need to call this program from the command line you have
several choices:
1. Create a command.  Have the command use CHGAPOPEN as the command
processing program.
2. Change the parameters to packed 15/5.
3. Pass them as characters and do the conversions.

Hope this helped

Buck Calabro
Aptis; Albany, NY

> -----Original Message-----
> From:   Jim Langston
> Sent:   Wednesday, January 19, 2000 3:05 PM
> To:     RPG400-L@midrange.com
> Subject:     Entry Parameters
>
> V3R7M0  RPGLE
>
> I wrote an RPGLE program that is supposed to accept four
> numeric values as parameters.
>
> D FromCompNum     S         2S 0
> D FromBatch       S         6S 0
> D ToCompNum       S         2S 0
> D ToBatch         S         6S 0
>
> C    *Entry    PList
> C              Parm       FromCompNum
> C              Parm       FromBatch
> C              Parm       ToCompNum
> C              Parm       ToBatch
>
> C              If         APComp = FromCompNum And
> C                         APBatc = FromBatch
> <SNIP>
>
> I call it thustly:
>
> CALL PGM(JIMCONEX/CHGAPOPEN) PARM(51 990110 51 000120)
>
> The If statement bombs with a Decimal Data Error.  Putting it in Debug
> Mode, I see that my four parameters contain garbage.  How am I supposed
> to call this thing?  Do I have to pass them as character strings?  If
> so, I would
> create a Data Structure Like:
>
> D                     DS
> D                                  FromCompNum    1    2S 0
> D                                  FromCompAsStr   1    2
>
> Then put FromCompAsStr in my Parm statement.  Is this what I have to do?
>
> I know this will work, I have done it in the past, and will do it now
> while
> waiting for a response, but isn't there another way?
>
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---




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


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.