× 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 between CL and RPG (was RPG Display program and processing)
  • From: Jim Langston <jlangston@xxxxxxxxxxxxxxxx>
  • Date: Tue, 25 Jul 2000 13:37:39 -0700

Well, this is fine, if your CL is the one declaring them.

These are declared in my display file, company number and as of date.

Company number is a 2 digit numeric, and as of date is 6 digit numeric.

I could, of course, declare 2 more variables as 15, 5 and pass the values from
the display file into them, then pass them along to my RPG, but what is the 
difference
if I have to declare 2 new variables anyway?

One way they are declared as numeric 15, 5 which is the right data type, but the
wrong lenght, the other was is to declare them as *char 2 and *char 6 which is 
the
wrong data type but the right length.

Either way, I'm "lying" to the maintainance programmer who has to follow me.  I
would prefer to keep my RPG "pure" so it accepts the right data type and the 
right
length.  Any skuldrudgery I then can keep in my CL.

Regards,

Jim Langston

Buck Calabro wrote:

> Jim Langston wrote:
>
> >The one pain is the first CL converts the
> >two numeric fields to alpha and
> >then passes them to the second CL.
> >The second CL passes the numbers
> >as characters, as there's the imfamous
> >15,2 problem with passing numbers
> >between CL and RPG.
>
> As an aside, there's no problem at all passing numeric parameters between CL
> and RPG - even via SBMJOB.  Declare them to be 15,5 and Bob's your uncle.
> This is because the command line (or CMD parm on SBMJOB, etc.) has no
> explicit declaration of numeric values, so it allocates storage for them in
> the form of Packed 15 with 5 decimals.
>
> PGM
>
> DCL &NUMBER *DEC (15 5) VALUE(75)
> SBMJOB CMD(CALL SBMJOB2 &NUMBER) +
>        JOB(SBMJOB)
>
> ENDPGM
>
> d NumberParm      s             15p 5
>
> c     *Entry        plist
> c                   parm                    NumberParm
>
> c                   if         NumberParm > 10
> c     '>10'         dsply     'BUCK'
> c                   endif
>
> c                   dump
> c                   eval       *InLR = *On
>
> Buck Calabro
> Aptis; Albany, NY
> "We are what we repeatedly do.
>  Excellence, then, is not an act, but a habit." --Aristotle
>
> Billing Concepts Corp., a NASDAQ Listed Company, Symbol: BILL

+---
| 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-Ups:
Replies:

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.