Need a help on Screen entry
Michael Lee
mcl_systems@bc.sympatico.ca
Thu, 07 Oct 1999 07:59:23 -0700
Seems like the specs need to be a bit more detailed. You mention that if the user enters an incorrect interest they should be allowed to reenter the effective date and the interest again and that if this happens that the previous interest rate should be set to invalid.
This sounds to me like what you want is that if the user puts in the same EFFECTIVE-DATE as a previous entry and keys in a different INTEREST rate that the VALID flag of that previous entry should be set to 'N' automatically.
If this is the case (and please correct me if I've misunderstood) the your problem would seem to be that since the user hasn't updated yet that you cannot check the first entry as it is not yet on file (no PUT has taken place).
Again, if this is the case there are two ways to handle it:
1) Do a PUT after the entry of the VALID flag so that the value IS on file. The problem with this is that you will lose your rollback capability and it's generally not a good idea.
2) In the PROCESS procedure of the VALID flag (if it's not set automatically already) put in a FOR loop and a GET to check to see if the value has already been entered. In this example there is a PUT inside the PROCESS procedure which would not get the default rollback. If this is
a problem (and some would definitely frown on this) you could fairly easily transport this code to the UPDATE procedure itself. Here is an example:
PROCEDURE PROCESS VALID
BEGIN
;First check any existing data that might already be on file.
GET MY-INTEREST-FILE-DES VIA EFFECTIVE-DATE USING & EFFECTIVE-DATE OF MY-INTEREST-FILE OPTIONAL
IF ACCESSOK
THEN BEGIN
IF VALID OF MY-INTEREST-FILE = 'Y'
THEN BEGIN
LET VALID OF MY-INTEREST-FILE-DES = 'N'
PUT MY-INTEREST-FILE-DES ;<-- This PUT would be required.
END
END
ELSE IF VALID = 'Y' ;<-- assuming this is not needed otherwise
LET T-OCCURRENCE = OCCURRENCE ;<--- To keep track of
; where you are
LET T-EFF-DATE = EFFECTIVE-DATE OF MY-INTEREST-FILE
FOR MY-INTEREST-FILE
BEGIN
IF EFFECTIVE-DATE OF MY-INTEREST-FILE = &
T-EFF-DATE AND &
OCCURRENCE <> T-OCCURRENCE
THEN BEGIN
LET VALID OF MY-INTEREST-FILE = 'N'
END
END
I hope I've understood the problem and that these answers help. If I have misunderstood the problem please let me know.
Michael Lee
MCL Systems Inc.
Krishna Vivek wrote:
> Hi Folks
>
> I am working on a screen and I really need your help.
>
> Security Code: 755RY9901
>
> Effective-Date Interest Valid
> -------------------- ----------- ---------
> June 28, 1999 .333 Y
> June 30, 1999 .332 N
> June 30, 1999 .342 Y
>
> In this screen you can only enter data. if the user is entered an incorrect interest, then he is allowed to enter the effective date again and enter the interest, When a new interest is entered for an existing effective date, the system would turn the first entry as invalid.
>
> I have tried so many ways, but no luck yet.
>
> Thank you all in advance.
> Krishna
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.