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




I am assuming that you have a file with this data on, and in its simplest
form is

Review date
Employee number
Employee last name
Employee first name
Employee middle initial
Employee supervisor.


Why not just create a sub file that displays each record in ascending
review date order
Once the employee has been reviewed, the review date should be increased by
a year (or some predetermined time factor), and therefore go to the end of
the list.
This way it can be seen if anyone has missed their review date, and by
which supervisor.



Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx

rpg400-l-bounces@xxxxxxxxxxxx wrote on 11/09/2006 01:59:19 PM:

I assume you have a file which has the names of the team members and a
date
by which their review is due correct?

Why not do a date diff comparing the current date to the stored date, if
the
difference is 30 or less, write it t the report?



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Kim Spears
Sent: Thursday, November 09, 2006 10:13 AM
To: RPG400-L@xxxxxxxxxxxx
Subject: How to select for future event

Hello Friends,

I have been looking at this too long and have concluded that I may be
missing something simple.

My assignment is to make an application to notify supervisors that a
review is due for a team member one month in the future. I have tried
several approaches; the first one wound up missing team members (bad),
my current approach duplicates notice events when the previous month is
longer then the succeeding month, i.e. January (better).

I cannot seem to devise a simple way to filter the extra selections,
which leads me to believe that I might be headed in the wrong direction
entirely.

It occurs to me that I may be trying to reinvent the wheel. Does anyone
here have an elegant routine for matching a date in the past to the
current date plus a month, without missing or duplicating events?

Here is what I have done so far:

*************** Beginning of data
*****************************************
H dftactgrp(*no) bnddir('BINDDIR')

FDB2FILE   IF   E           K DISK

FQPRINT    O    F  198        PRINTER

 /COPY QSOURCE,$DATE_P

D compareDate     S               D

D compareYear     S              4  0

D fileDate        S               D

D fileYear        S              4  0

D runDate         S               D   INZ(D'2006-01-01')



C                   DO        365

C                   EVAL      compareDate = runDate + %MONTHS(1)

C                   EVAL      compareYear = %subdt(compareDate : *YEARS)

C                   EXSR      $runDate

C                   EVAL      runDate += %DAYS(1)

C                   ENDDO



C                   EVAL      *INLR = *ON


************************************************************************
**
C     $runDate      BEGSR



C     *LOVAL        SETLL     DB2FILE                            99

C                   READ      DB2FILE                                99



C                   DOW       ( *IN99 = *OFF)

 * Convert file date format to ISO format.

C                   EVAL      fileDate = $D5toISO(ehdate)

C                   EVAL      fileYear = %subdt(fileDate : *YEARS)



C                   IF        ( fileYear < compareYear )



 * Synchronize years so comparison can be made

C                   EVAL      fileDate += %YEARS(compareYear - fileYear)

C                   IF        ( fileDate = compareDate )

C                   EXCEPT    LINE

C                   ENDIF



 * If September, April, June or November... extend comparison to 31 days

C                   IF        ( %subdt(runDate : *MONTHS) = 9 ) OR

C                             ( %subdt(runDate : *MONTHS) = 4 ) OR
C                             ( %subdt(runDate : *MONTHS) = 6 ) OR
C                             ( %subdt(runDate : *MONTHS) = 11 )
C                   IF        ( %subdt(runDate : *DAYS) = 30 ) AND
C                             ( fileDate = compareDate + %DAYS(1) )
C                   EXCEPT    LINE
C                   ENDIF
C                   ENDIF

C                   ENDIF

C                   READ      DB2FILE                                99
C                   ENDDO

C                   ENDSR
 ******
OQPRINT    E            LINE       01
O                       FName               16
O                       LName               38
O                       HDate               46
O                       runDate             65
O                       compareDate         87
****************** End of data
********************************************



--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.







****************************************************************************

This transmission may contain information that is privileged,
Confidential and/or exempt from disclosure under applicable law.
If you are not the intended recipient, you are hereby notified that
any disclosure, copying, distribution, or use of the information
contained herein (including any reliance thereon) is STRICTLY
PROHIBITED. If you received this transmission in error, please
immediately contact the sender and destroy the material in its
entirety, whether in electronic or hard copy format. Thank you.

****************************************************************************


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

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.