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



Sorry to be so late in responding. Have been up to my neck in alligators. 

>> I am developing a program (V4R2) which needs to pass a fiscal year to
>> another program and return the 12 fiscal period ends 

Not trying to offensive but I think is an excellent example of how we had to
think RPG III vs. the kind of thinking we need to do in RPG ILE.

This solution is how we always had to do it in RPGIII and how insanely
complicated it gets trying to do this. Why, we didn't want to make a lot of
dynamic calls to a program.

With RPG ILE, we are faced with a whole new paradigm. We now can code
procedures in our modules or in especially in a service program and the
performance is excellent. So we need to break things down into single
functions that perform one task and return a result.

Thinking in this way, it occurs to that the better solution would be to have
a function called GetFiscalPeriodBegEnd that receives the Year and Period
number and returns the beginning and ending dates for a period. You could
encapsulate this logic and possibly all other functions related to
calendaring  in one service program. This kind of thing would have very
difficult to do in RPG III because you had a single point of entry to a
program. Now it is a piece of cake. I have written a bunch of these
functions in service programs and it is sweet. Now instead of creating the
same code in program after program and doing all the stuff involved before
and all the errors that created, I can just do the following:

eval ehResult = GetNumberOfFiscalPeriods(Year,rtnPeriodCount)
do  rtnPeriodCount CurrPeriod
eval ehResult =
GetFiscalPeriodBegEnd(Year,CurrentPeriod,RtnBegDate,RtnEndDate)
if   ehResult = cNormalEnd
   -- Do something with dates.
else
   -- Do error handling.
endif
enddo

This anyone have a better way to do this in RPG ILE? 

In that way, I avoid all the manually coding and trying to get data
structures to balance between programs. This, also, could be done in RPG III
if this is not called often. 

Just a suggestion.

Love ILE RPG but changing my thinking sometimes really gets rough. Start
writing something and then realize two or three programs down that I was
thinking in RPG III instead of RPG ILE and have to go back and code the
functions. Amazing how the code just seems to vanish. All that code in each
program is replaced by a couple of lines of code!

Thanks in advance for any responses.

-----Original Message-----
From: Carl Pitcher [mailto:cpitcher@roadrunner.nf.net]
Sent: Tuesday, October 26, 1999 3:14 PM
To: RPG400-L@midrange.com
Subject: RPG parameters


I am developing a program (V4R2) which needs to pass a fiscal year to
another program and return the 12 fiscal period ends which I would like to
define as an array.  Since *ENTRY  PLIST doesn't allow passing of array
elements or data structures, are there any suggestions as to how I can
implement this without passing 12 PARM fields for the dates and then moving
them to array elements on the return?  Also, can anyone recommend a book
that provides some good, complete examples (not snippets) of ILE
programming.  Thanks.

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