× 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: Missing from RPG/LE
  • From: Hans Boldt <boldt@xxxxxxxxxx>
  • Date: Thu, 1 Oct 1998 09:51:58 -0400

Joe Teff wrote:
>How might the %REM be used? For example I have the following lines of code
>and I needed both the result and the remainder:
>
>  C              Year        Div       4       Result
>  C                          MvR               Remainder

You'd code something like:

   C                EVAL      Result = %DIV(Year:4)
   C                EVAL      Remainder = %REM(Year:4)

Note that %DIV and %REM are not as flexible as the opcodes.
When coding the fixed-format opcodes, the precisions of the
result fields are known fully and influence the precisions
of the results.  With the new built-in functions, we don't
have the same information.  So, the BIFs are limited to
numeric operands with zero decimal places and so cannot be
considered full replacements for the DIV and MVR opcodes.

>I recently purchased "Java for RPG Programmers" (through the way David
>suggested) and I looked for the section on threads. This concept reminds
>me very much of my days writing EDL on the Series/1. Although it has been
>some time since I used that (about 14 yrs ago), I vaguely remember using >this
same technique then, though I believe the term used was task or
>sub-tasks. Is it reasonable to think that we will eventually get that
>capability in RPG? I have "faked" this technique in the past where I had
>a program with a large load-time because of file opens, initializing
>loigic, etc. I would do as little as possible to get te first screen up
>including using user open on most files, issue a write for the screen,
>do the rest of the load-time and then issue a read from the screen. On
>succeeding passes through the code, I would use EXFMT. I could usually
>get the rest of the load-time completed before the user actually hit the
>ENTER or an F-key. It made it look like I really speeded the program
>up to the users. It would have been nice to execute the load-time logic
>with a thread instead. I'm sure we could find many uses for this
>technique if it was generally available for use in RPG.

Our support with threads is rather rudimentary.  By
specifying a keyword on the H-Spec, you can ensure
that code within a module is active in only one
thread at a time.  Is it reasonable to expect Java
like threading functionality in RPG?  No.  RPG
programs contain too much static data for us to be
able to handle threading in a more flexible manner.

If you want more information on threads, check out:
http://www.softmall.ibm.com:80/as400/threads/.

Cheers!  Hans

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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.