Good morning, working on a program that reads a card from a scanner and loads it onto a DSPF, the program does a WRITE, then READ(E) on the display file when the scan field is populated. It seems it gets errors pretty frequently when someone has clocked in in the morning and the screen has sat on that last record for a few hours. I want to make this more reliable on the read of the scanned number, it does get to the DSPF field intact, but for some reason the READ(E) has an error and the logic has the program loop and redisplay. I will be putting a 'READ ERROR - TRY AGAIN' message on this error, but is there a more reliable way to code this?
************************************************** *************
Thanks in advance.
************************************************** *************
Code:
FPRBADGL4 IF E K DISK FTKMSTRL6 IF E K DISK FTMC003D CF E WORKSTN f maxdev(*file) * D SDS D SPGM *PROC D JOBNAM 244 253 D USERNM 254 263 * C*================================================ ============= C* C* EXECUTE SCREEN C* C begin TAG C MOVE *BLANKS @IDNUM C MOVE *BLANKS SIDNUM 10 C MOVE *BLANKS @FNAME C MOVE *BLANKS @LNAME C Z-ADD 0 @DATE C Z-ADD 0 @TIME * C START TAG C TIME TIMDAT 12 0 C MOVEL TIMDAT stime 6 0 C MOVE TIMDAT sdate 6 0 C WRITE TMC003R1 C READ(e) TMC003D C IF %error C eval @FNAME = 'SCAN ERROR' C eval @LNAME = '- TRY AGAIN' C GOTO start C ENDIF C ENDIF C MOVE *BLANKS @FNAME C MOVE *BLANKS @LNAME C Z-ADD 0 @DATE C Z-ADD 0 @TIME C* C *IN01 CASEQ '1' EXIT C END C* C @IDNUM IFNE *BLANKS C @IDNUM ANDNE SIDNUM * C TESTN @IDNUM 50 C *IN50 IFEQ '0' C MOVEL 'INVALID#' @FNAME C MOVEL @IDNUM SIDNUM C GOTO START C ENDIF * C MOVEL @IDNUM SIDNUM C MOVE @IDNUM IDNUM# 9 0 C IDNUM# CHAIN PRBADGL4 90 C *IN90 IFEQ '1' C MOVEL 'INVALID#' @FNAME C MOVEL @IDNUM SIDNUM C GOTO START C ELSE * C PRKEY CHAIN TKMSTRL6 91 C *IN91 IFEQ '0' C MOVE FNAME @FNAME C MOVE LNAME @LNAME C ENDIF * C TIME TIMDAT 12 0 C MOVEL TIMDAT @TIME 6 0 C MOVE TIMDAT @DATE 6 0 C move @date pdate 6 C move @time ptime 6 C MOVE @IDNUM SIDNUM C MOVE @IDNUM IDNUMP 9 C movel jobnam @clock 10 C* CALL 'TMC003C1' C* PARM IDNUMP C* PARM @CLOCK C* PARM pdate C* PARM ptime C* GOTO START C ENDIF c ENDIF C* C GOTO START C* C* END MAIN ROUTINE C*
Thanks in advance.
Comment