我必须从旧的遗留代码中找到一些逻辑。我的经理说是 COBOL,我不确定。我试图在 cobol 教程上找到一些关键字,但没有任何运气。
以下是一些代码片段:
PROC(&QPROG);
VERIFY OFF PROC;DECLARE &MSG1 AS A75;
/* DON'T CALL SCREEN IF IT'S FROM */
IF &QPROG NE 'YUITG' THEN DO;
CALL QAAF;
SCREEN QUERY LOADED QAAF OTW DO;
PRINT 'SCREEN WILL NOT LOAD';
EXIT;
END;
END;
ON ERROR DO;PRINT &&RC;EXIT; END;
IF LENGTHB(&P_WHAT) = 4 THEN DO; &P_WHATT = SUBSTR(&P_WHAT,1,1) CAT
', ' CAT SUBSTR(&P_WHAT,2,1) CAT ', ' CAT SUBSTR(&P_WHAT,3,1) CAT
' & ' CAT SUBSTR(&P_WHAT,4,1);
END;
DECLARE &KEYWORDD_A(0) AS A1;
DECLARE &KEYWORDD_F(0) AS 99L;
&KEYWORDD_A=
(SUBSTR(&KEYWORDD,1,1),SUBSTR(&KEYWORDD,2,1),SUBSTR(&KEYWORDD,3,1),
SUBSTR(&KEYWORDD,4,1),SUBSTR(&KEYWORDD,5,1),SUBSTR(&KEYWORDD,6,1),
SUBSTR(&KEYWORDD,37,1),SUBSTR(&KEYWORDD,38,1),SUBSTR(&KEYWORDD,39,1),
SUBSTR(&KEYWORDD,40,1));
&KEYWORDD_F = FINDEX(&KEYWORDD_A = ' ',ALL);
IF &PROG EQ &NAV THEN DO;
&ALLPROG = 'YES';
&PROG = 'PR2';
END;
-TOP_PROG
CMS FILEDEF QAA2 DISK QAA2 NOMAD A6 (LRECL 100;
WRITE '/* REPORT */' ON QAA2;
WRITE '&GRP = ''' CATB &GRP CATB ''';' ON QAA2;
WRITE '&MGTRPT = ''' CATB &QPROG CATB ''';' ON QAA2;
IF &RFROM NE &NAV THEN DO;
WRITE '&RFROM = ''' CATB DISPLAY(&RFROM) CATB ''';' ON QAA2;
END;
CLOSE QAA2;