How to setup a reminder in RPG ILE?

2880 pts.
Hi all! I have a Physical file lets say MYPF01. In that I have a filed for Expiry Date (*ISO format). There are many records on the Physical file. If suppose i want to setup a reminder program (in RPGLE) to check that physical file everyday and if that date is expired (comparing current date) to show a pop window in the application. By which way/method can I achieve this? Please help. Surey.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 8  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • philpl1jb

    So you're looking for all rows where Expiry Date  > %date()

    that would be quickest if you have a logical or index on Expiry Date. Then it could be an SQL or Setll and read loop.

    54,090 pointsBadges:
  • TheRealRaven
    How do you intend to run the program? If it will "show a pop window", where are you expecting the window to appear?

    A scheduled job will be a batch job; it won't have any device on which it can display any window. And if you're just going to call it from an interactive session, it will work like any interactive program with a display file.
    36,145 pointsBadges:
  • Sureyz
    When a user go on a particular screen then the pop up will appear. As you said it can be done by a call program. But in the popup window i need to display all the fields may be in a subfile. But i need to give an option to the user like (noted) then that record should not appear for other users who comes across pop up window program.

    Thanks for your suggestions.

    2,880 pointsBadges:
  • azohawk

    A couple of questions, can you add fields to the file?  If someone flags the record as noted, is there a point in time after which you want to have the the record re-appear in the list (i.e. the expiry date was Feb 1, It was noted on Feb 2, on Feb 15 it is still in file and nothing has happened to it, so you want to force it to reappear on the list).

    If you can add fields to file, a field "noted" (Alpha 1) that simply flags it as Y or blank (then add to your date criteria indicated in another post in this thread) and NOTED = *blank (or equivelant).  OR

    If you want it to reappear after x days. the field you would add would be "noted dated"  then you could add something like: where expiry date > %date() and noted dated < (%date()-%days(14)).

    If you cannot add fields to the file, you may need to create a new file with the key fields from your primary file plus your noted (or noted date) field then cross reference. This is a little more involved but still able to be done.   

    4,055 pointsBadges:
  • aceofdelts

    I'd start with a log file. Key is Date. So certain program(s) start by chaining to this file using system date. If record found then skip the reminder program. Else call reminder program to prompt for (A) handle expiry logic now - write log record and submit expiry program   or   (B) Ignore and no expiry run today - write log record and "done"   or   (C) Ignore and today still needs an answer - so "done" here but next user gets prompted.

    Log file can be Date, UserID, action code (A, B, or C)

    So helpful to see who ran Expiry or said to ignore it

    Easy to remove a date record, thus reprompt is active again.

    2,550 pointsBadges:
  • TheRealRaven
    If two (or more) users have the window on their screens at the same time, they all will see the same rows until their screens are refreshed and some of the records have been processed.
    36,145 pointsBadges:
  • deepu9321
    In this case, You can have the file locked while reading. 

    And, Check the file whether this is locked before coming to the screen. And, display error message accordingly to wait for some time or something which matches your requirement. 
    4,980 pointsBadges:
  • Yorkshireman
    So many solutions to this question.
    Some of them are volume related.  Different issues if we are discussing for a file of 80 million records with 100,000 a day going over your date limit to a file of 100,000 and 3 a day may be involved. 

    First, a comprehensive solution to multi users.  As others noted, if 10 users fire up at 8:59 hours they must either all get all records, or only the first gets all records.   if there are 10,000 to deal with, do they each get 1000?  

    and for a 'large' file to get better response, some form of access path is needed.  

    the little mechanisms to flag up records for all (other) users that are being displayed elsewhere is  simple enough, but would mean that rolling a subfile would have to refresh each record.  

    intriguing little question though. 

    6,085 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: