我有以下 Easytrieve Plus 代码:
*
FILE ENTRADA
INPUT-REC1 1 132 A
*
*
FILE SALIDA
C1-JOBNAME 1 16 A
C1-FILLER 17 5 A
C1-MENSAGEM 22 31 A
*
DEFINE WS-INREC1 W 132 A
*
DEFINE WS-INDIC1 WS-INREC1 1 A
*
DEFINE WS-INPUT1 WS-INREC1 16 A
*
*
DEFINE WS-INREC2 W 132 A
*
DEFINE WS-INDIC2 WS-INREC2 1 A
*
DEFINE WS-INPUT2 WS-INREC2 16 A
*
DEFINE WS-MSG1 W 31 A VALUE 'INSERIR PARAMETROS CA-VIEW. '
*
DEFINE WS-MSG2 W 31 A VALUE 'PARÂMETROS CORRECTOS. '
*
DEFINE WS-MSG3 W 31 A VALUE 'PARÂMETROS INCORRECTOS. '
*
DEFINE WS-COUNT W 8 N VALUE 0
*
DEFINE WS-COUNT-VAL W 8 N VALUE 0
*
* PROCESO
*
JOB INPUT NULL
DO WHILE NOT EOF ENTRADA
IF WS-COUNT = 0
GET ENTRADA
MOVE INPUT-REC1 TO WS-INREC1
WS-COUNT = WS-COUNT + 1
END-IF
IF WS-INDIC1 = 'J' AND NOT EOF ENTRADA
GET ENTRADA
WS-COUNT = WS-COUNT + 1
WS-COUNT-VAL = WS-COUNT
DISPLAY 'WS-COUNT: ' WS-COUNT
MOVE INPUT-REC1 TO WS-INREC2
IF WS-INDIC2 = 'J'
MOVE WS-MSG1 TO C1-MENSAGEM
MOVE WS-INPUT1 TO C1-JOBNAME
DISPLAY 'CJ-JOBNAME:' C1-JOBNAME
MOVE WS-INREC2 TO WS-INREC1
ELSE
IF WS-INPUT2 = 'F RF CNF CH '
MOVE WS-MSG3 TO C1-MENSAGEM
MOVE WS-INPUT1 TO C1-JOBNAME
DISPLAY 'CF3-JOBNAME:' C1-JOBNAME
END-IF
IF WS-INPUT2 = 'F RF CH '
MOVE WS-MSG2 TO C1-MENSAGEM
MOVE WS-INPUT1 TO C1-JOBNAME
DISPLAY 'CF2-JOBNAME:' C1-JOBNAME
END-IF
GET ENTRADA
WS-COUNT = WS-COUNT + 1
DISPLAY 'WS-COUNT2: ' WS-COUNT
MOVE INPUT-REC1 TO WS-INREC1
END-IF
END-IF
PUT SALIDA
END-DO
STOP
此代码在一次安装时可以正常工作,而在另一次安装时会显示以下消息:
68 *******A010 INVALID FILE REFERENCE - ENTRADA
输入文件如下所示:
JOBNAME:ADJADP0
F RF CH
JOBNAME:ADJBDK1
F RF CH
JOBNAME:BMRPNN2
JOBNAME:BMRP1N1
F RF CNF CH
JOBNAME:BMRP1N2
F RF CNF CH
JOBNAME:IU3A02J4
F RF CH
JOBNAME:IU3A02J5
F RF CH
和输出文件:
JOBNAME:ADJADP0 PARÂMETROS CORRECTOS.
JOBNAME:ADJBDK1 PARÂMETROS CORRECTOS.
JOBNAME:BMRPNN2 INSERIR PARAMETROS CA-VIEW.
JOBNAME:BMRP1N1 PARÂMETROS INCORRECTOS.
JOBNAME:BMRP1N2 PARÂMETROS INCORRECTOS.
JOBNAME:IU3A02J4 PARÂMETROS CORRECTOS.
JOBNAME:IU3A02J5 PARÂMETROS CORRECTOS.
在它不起作用的安装中,Easytrieve 步骤以条件代码 0016 结束,但会生成一个输出文件(它只是不处理最后一条记录):
JOBNAME:ADJADP0 PARÂMETROS CORRECTOS.
JOBNAME:ADJBDK1 PARÂMETROS CORRECTOS.
JOBNAME:BMRPNN2 INSERIR PARAMETROS CA-VIEW.
JOBNAME:BMRP1N1 PARÂMETROS INCORRECTOS.
JOBNAME:BMRP1N2 PARÂMETROS INCORRECTOS.
JOBNAME:IU3A02J4 PARÂMETROS CORRECTOS.
它给出的错误是:
68 *******A010 INVALID FILE REFERENCE - ENTRADA
FILE STATISTICS - E Z T PLUS 5.2D- 3/07/17-19.42-JSN00036
ENTRADA 13 INPUT SAM FIX BLK 132 2
SALIDA 6 OUTPUT SAM FIX BLK 132 3
*******A014 PREMATURE TERMINATION DUE TO PREVIOUS ERROR(S)