Hi! I have a TPS data file that stores signals received from a modem. Most of the time the previous record contains the Caller ID information and its protocol would be type 4. If the signal is a type P, I would like to look at the previous record see if it it is a type 4 then make sure the account number matches the current record in memory. If both conditions are true assign the date and time from this previous record to the record in memory and then save the record in memory as the last record in the file. I wondering if by reading the previous record if my current variables in memory ((SLRW:Protocol, etc) will be overwritten without me assigning new values to them. I am not getting any compile errors. In otherwords, I only want to replace the values of SLRW:DATE & SLRW:Time if there are values found in the previous record. Are there any errors in my logic? Thank you in advance. Chuck Part of a case statement SLRW:PROTOCOL = CLIP(SUB(RxString,1,1)) !Assignment SLRW:RECEIVER = CLIP(SUB(RxString,2,2)) !Assignment SLRW:LINE_NO = CLIP(SUB(RxString,4,1)) !Assignment IF CLIP(SLRW:PROTOCOL) = 'P' SLRW:FIELD_4 = CLIP(SUB(RxString,6,11)) PREVIOUS(SLRMessages) !new code ** read previous record ** Loc:Protocol = SLRW:Protocol Loc:ReceiverAccountNumber = LEFT(CLIP(SUB(SLRW:FIELD_4,3,4))) Loc:DateReceived = SLRW:Date Loc:TimeReceived = SLRW:Time IF SLRW:PROTOCOL = '4' AND LEFT(CLIP(SUB(SLRW:FIELD_4,3,4))) = Loc:ReceiverAccountNumber SLRW:TIME = Loc:DateReceived SLRW:DATE = Loc:TimeReceived ELSE SLRW:TIME = CLOCK() SLRW:TIME = INT(SLRW:TIME / 6000) * 6000 + 1 SLRW:DATE = TODAY() END!IF !end of new code SLRW:FIELD_6 = '-' SLRW:FIELD_7 = CLIP(SUB(RxString,17,Len(RxString)-17)) !Assignment SLRW:Imported = 1 ELSIF CLIP(SLRW:PROTOCOL) = 'S' !not supported protocol CYCLE ELSE !if non digital format SLRW:FIELD_4 = CLIP(SUB(RxString,5,16)) !Assignment SLRW:TIME = DEFORMAT(CLIP(SUB(RxString,21,5)),@T1) !Assignment SLRW:FIELD_6 = CLIP(SUB(RxString,26,1)) !Assignment SLRW:DATE = DEFORMAT(CLIP(SUB(RxString,27,8)),@D5) !Assignment SLRW:TERMNTR = CLIP(SUB(RxString,35,1)) !Assignment SLRW:Imported = 1 END!IF ADD(SLRMessages) ! ADD(SLRQueue) !!Add message to the queue Display(?List) !! END!IF