From 193a22b80fdcc69ecad2f3c696508ad151add9f1 Mon Sep 17 00:00:00 2001 From: Ilidio Lopes Date: Wed, 8 Jan 2025 15:39:26 +0100 Subject: [PATCH 1/2] Implementation of HANDLE statement in CICS --- .../cobol/implicitDialects/cics/CICSParser.g4 | 14 +- .../CICSHandleOptionsCheckUtility.java | 258 +++++++++++ .../utility/CICSOptionsCheckBaseUtility.java | 2 +- .../cics/utility/CICSOptionsCheckUtility.java | 3 + .../src/main/resources/LanguageKeywords.txt | 106 ++++- .../lsp/cobol/usecases/TestCICSHandle.java | 404 ++++++++++++++++++ .../TestCicsExciGetContainerStatement.java | 2 +- .../usecases/TestExecCicsHandleAidClear.java | 2 +- 8 files changed, 778 insertions(+), 13 deletions(-) create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSParser.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSParser.g4 index 1fe0b500e0..797686a1ed 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSParser.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/implicitDialects/cics/CICSParser.g4 @@ -423,15 +423,11 @@ cics_getnext_container: (CONTAINER cics_data_area | BROWSETOKEN cics_data_value /** HANDLE CONDITION / HANDLE AID / HANDLE ABEND: */ cics_handle: HANDLE (cics_handle_abend | cics_handle_aid | cics_handle_condition); -cics_handle_abend: ABEND (CANCEL | PROGRAM cics_name | LABEL cics_label | RESET | cics_handle_response)*; -cics_handle_aid: AID (ANYKEY (cics_label)? | CLEAR (empty_parens | cics_label)? | CLRPARTN (cics_label)? | ENTER (cics_label)? | - LIGHTPEN (cics_label)? | OPERID (cics_label)? | pa_option (cics_label)? | pf_option (cics_label)? | - TRIGGER (cics_label)? | cics_handle_response)*; -cics_handle_condition: CONDITION ((cics_conditions | cicsWord) cics_label? | cics_handle_response)+; - -pa_option: PA1 | PA2 | PA3; -pf_option: PF1 | PF2 | PF3 | PF4 | PF5 | PF6 | PF7 | PF8 | PF9 | PF10 | PF11 | PF12 | PF13 | PF14 | PF15 | PF16 | PF17 | - PF18 | PF19 | PF20 | PF21 | PF22 | PF23 | PF24; +cics_handle_abend: (ABEND | CANCEL | PROGRAM cics_name | LABEL cics_label | RESET | cics_handle_response)+; +cics_handle_aid: (AID | (ANYKEY | CLEAR | CLRPARTN | ENTER | LIGHTPEN | OPERID | PA1 | PA2 | PA3 | PF1 | PF2 | PF3 | PF4 | PF5 | + PF6 | PF7 | PF8 | PF9 | PF10 | PF11 | PF12 | PF13 | PF14 | PF15 | PF16 | PF17 | PF18 | PF19 | PF20 | PF21 | PF22 | + PF23 | PF24 | TRIGGER) (cics_label)? | cics_handle_response)+; +cics_handle_condition: (CONDITION | cics_conditions (cics_label)? | cics_handle_response)+; /** IGNORE CONDITION */ cics_ignore: IGNORE cics_ignore_options; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java new file mode 100644 index 0000000000..6ee8bee75f --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.implicitDialects.cics.utility; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.TerminalNode; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSLexer; +import org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static org.eclipse.lsp.cobol.implicitDialects.cics.CICSParser.RULE_cics_handle; + +/** Checks CICS HANDLE rules for required and invalid options */ +public class CICSHandleOptionsCheckUtility extends CICSOptionsCheckBaseUtility { + public static final int RULE_INDEX = RULE_cics_handle; + + private static final Map DUPLICATE_CHECK_OPTIONS = + new HashMap() { + { + put(CICSLexer.CONDITION, ErrorSeverity.WARNING); + put(CICSLexer.ABEND, ErrorSeverity.ERROR); + put(CICSLexer.CANCEL, ErrorSeverity.WARNING); + put(CICSLexer.PROGRAM, ErrorSeverity.ERROR); + put(CICSLexer.LABEL, ErrorSeverity.ERROR); + put(CICSLexer.RESET, ErrorSeverity.WARNING); + put(CICSLexer.AID, ErrorSeverity.WARNING); + put(CICSLexer.ANYKEY, ErrorSeverity.ERROR); + put(CICSLexer.CLEAR, ErrorSeverity.ERROR); + put(CICSLexer.CLRPARTN, ErrorSeverity.ERROR); + put(CICSLexer.ENTER, ErrorSeverity.ERROR); + put(CICSLexer.LIGHTPEN, ErrorSeverity.ERROR); + put(CICSLexer.OPERID, ErrorSeverity.ERROR); + put(CICSLexer.PA1, ErrorSeverity.ERROR); + put(CICSLexer.PA2, ErrorSeverity.ERROR); + put(CICSLexer.PA3, ErrorSeverity.ERROR); + put(CICSLexer.PF1, ErrorSeverity.ERROR); + put(CICSLexer.PF2, ErrorSeverity.ERROR); + put(CICSLexer.PF3, ErrorSeverity.ERROR); + put(CICSLexer.PF4, ErrorSeverity.ERROR); + put(CICSLexer.PF5, ErrorSeverity.ERROR); + put(CICSLexer.PF6, ErrorSeverity.ERROR); + put(CICSLexer.PF7, ErrorSeverity.ERROR); + put(CICSLexer.PF8, ErrorSeverity.ERROR); + put(CICSLexer.PF9, ErrorSeverity.ERROR); + put(CICSLexer.PF10, ErrorSeverity.ERROR); + put(CICSLexer.PF11, ErrorSeverity.ERROR); + put(CICSLexer.PF12, ErrorSeverity.ERROR); + put(CICSLexer.PF13, ErrorSeverity.ERROR); + put(CICSLexer.PF14, ErrorSeverity.ERROR); + put(CICSLexer.PF15, ErrorSeverity.ERROR); + put(CICSLexer.PF16, ErrorSeverity.ERROR); + put(CICSLexer.PF17, ErrorSeverity.ERROR); + put(CICSLexer.PF18, ErrorSeverity.ERROR); + put(CICSLexer.PF19, ErrorSeverity.ERROR); + put(CICSLexer.PF20, ErrorSeverity.ERROR); + put(CICSLexer.PF21, ErrorSeverity.ERROR); + put(CICSLexer.PF22, ErrorSeverity.ERROR); + put(CICSLexer.PF23, ErrorSeverity.ERROR); + put(CICSLexer.PF24, ErrorSeverity.ERROR); + put(CICSLexer.TRIGGER, ErrorSeverity.ERROR); + put(CICSLexer.NORMAL, ErrorSeverity.ERROR); + put(CICSLexer.ERROR, ErrorSeverity.ERROR); + put(CICSLexer.RDATT, ErrorSeverity.ERROR); + put(CICSLexer.WRBRK, ErrorSeverity.ERROR); + put(CICSLexer.EOF, ErrorSeverity.ERROR); + put(CICSLexer.EODS, ErrorSeverity.ERROR); + put(CICSLexer.EOC, ErrorSeverity.ERROR); + put(CICSLexer.INBFMH, ErrorSeverity.ERROR); + put(CICSLexer.ENDINPT, ErrorSeverity.ERROR); + put(CICSLexer.NONVAL, ErrorSeverity.ERROR); + put(CICSLexer.NOSTART, ErrorSeverity.ERROR); + put(CICSLexer.TERMIDERR, ErrorSeverity.ERROR); + put(CICSLexer.FILENOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.NOTFND, ErrorSeverity.ERROR); + put(CICSLexer.DUPREC, ErrorSeverity.ERROR); + put(CICSLexer.DUPKEY, ErrorSeverity.ERROR); + put(CICSLexer.INVREQ, ErrorSeverity.ERROR); + put(CICSLexer.IOERR, ErrorSeverity.ERROR); + put(CICSLexer.NOSPACE, ErrorSeverity.ERROR); + put(CICSLexer.NOTOPEN, ErrorSeverity.ERROR); + put(CICSLexer.ENDFILE, ErrorSeverity.ERROR); + put(CICSLexer.ILLOGIC, ErrorSeverity.ERROR); + put(CICSLexer.LENGERR, ErrorSeverity.ERROR); + put(CICSLexer.QZERO, ErrorSeverity.ERROR); + put(CICSLexer.SIGNAL, ErrorSeverity.ERROR); + put(CICSLexer.QBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ITEMERR, ErrorSeverity.ERROR); + put(CICSLexer.PGMIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TRANSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.ENDDATA, ErrorSeverity.ERROR); + put(CICSLexer.INVTSREQ, ErrorSeverity.ERROR); + put(CICSLexer.EXPIRED, ErrorSeverity.ERROR); + put(CICSLexer.RETPAGE, ErrorSeverity.ERROR); + put(CICSLexer.RTEFAIL, ErrorSeverity.ERROR); + put(CICSLexer.RTESOME, ErrorSeverity.ERROR); + put(CICSLexer.TSIOERR, ErrorSeverity.ERROR); + put(CICSLexer.MAPFAIL, ErrorSeverity.ERROR); + put(CICSLexer.INVERRTERM, ErrorSeverity.ERROR); + put(CICSLexer.INVMPSZ, ErrorSeverity.ERROR); + put(CICSLexer.IGREQID, ErrorSeverity.ERROR); + put(CICSLexer.OVERFLOW, ErrorSeverity.ERROR); + put(CICSLexer.INVLDC, ErrorSeverity.ERROR); + put(CICSLexer.NOSTG, ErrorSeverity.ERROR); + put(CICSLexer.JIDERR, ErrorSeverity.ERROR); + put(CICSLexer.QIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOJBUFSP, ErrorSeverity.ERROR); + put(CICSLexer.DSSTAT, ErrorSeverity.ERROR); + put(CICSLexer.SELNERR, ErrorSeverity.ERROR); + put(CICSLexer.FUNCERR, ErrorSeverity.ERROR); + put(CICSLexer.UNEXPIN, ErrorSeverity.ERROR); + put(CICSLexer.NOPASSBKRD, ErrorSeverity.ERROR); + put(CICSLexer.NOPASSBKWR, ErrorSeverity.ERROR); + put(CICSLexer.SEGIDERR, ErrorSeverity.ERROR); + put(CICSLexer.SYSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.ISCINVREQ, ErrorSeverity.ERROR); + put(CICSLexer.ENQBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ENVDEFERR, ErrorSeverity.ERROR); + put(CICSLexer.IGREQCD, ErrorSeverity.ERROR); + put(CICSLexer.SESSIONERR, ErrorSeverity.ERROR); + put(CICSLexer.SYSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.SESSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.NOTALLOC, ErrorSeverity.ERROR); + put(CICSLexer.CBIDERR, ErrorSeverity.ERROR); + put(CICSLexer.INVEXITREQ, ErrorSeverity.ERROR); + put(CICSLexer.INVPARTNSET, ErrorSeverity.ERROR); + put(CICSLexer.INVPARTN, ErrorSeverity.ERROR); + put(CICSLexer.PARTNFAIL, ErrorSeverity.ERROR); + put(CICSLexer.USERIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTAUTH, ErrorSeverity.ERROR); + put(CICSLexer.VOLIDERR, ErrorSeverity.ERROR); + put(CICSLexer.SUPPRESSED, ErrorSeverity.ERROR); + put(CICSLexer.RESIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NOSPOOL, ErrorSeverity.ERROR); + put(CICSLexer.TERMERR, ErrorSeverity.ERROR); + put(CICSLexer.ROLLEDBACK, ErrorSeverity.ERROR); + put(CICSLexer.END, ErrorSeverity.ERROR); + put(CICSLexer.DISABLED, ErrorSeverity.ERROR); + put(CICSLexer.ALLOCERR, ErrorSeverity.ERROR); + put(CICSLexer.STRELERR, ErrorSeverity.ERROR); + put(CICSLexer.OPENERR, ErrorSeverity.ERROR); + put(CICSLexer.SPOLBUSY, ErrorSeverity.ERROR); + put(CICSLexer.SPOLERR, ErrorSeverity.ERROR); + put(CICSLexer.NODEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TASKIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TCIDERR, ErrorSeverity.ERROR); + put(CICSLexer.DSNNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.LOADING, ErrorSeverity.ERROR); + put(CICSLexer.MODELIDERR, ErrorSeverity.ERROR); + put(CICSLexer.OUTDESCRERR, ErrorSeverity.ERROR); + put(CICSLexer.PARTNERIDERR, ErrorSeverity.ERROR); + put(CICSLexer.PROFILEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.NETNAMEIDERR, ErrorSeverity.ERROR); + put(CICSLexer.LOCKED, ErrorSeverity.ERROR); + put(CICSLexer.RECORDBUSY, ErrorSeverity.ERROR); + put(CICSLexer.UOWNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.UOWLNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.LINKABEND, ErrorSeverity.ERROR); + put(CICSLexer.CHANGED, ErrorSeverity.ERROR); + put(CICSLexer.PROCESSBUSY, ErrorSeverity.ERROR); + put(CICSLexer.ACTIVITYBUSY, ErrorSeverity.ERROR); + put(CICSLexer.PROCESSERR, ErrorSeverity.ERROR); + put(CICSLexer.ACTIVITYERR, ErrorSeverity.ERROR); + put(CICSLexer.CONTAINERERR, ErrorSeverity.ERROR); + put(CICSLexer.EVENTERR, ErrorSeverity.ERROR); + put(CICSLexer.TOKENERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTFINISHED, ErrorSeverity.ERROR); + put(CICSLexer.POOLERR, ErrorSeverity.ERROR); + put(CICSLexer.TIMERERR, ErrorSeverity.ERROR); + put(CICSLexer.SYMBOLERR, ErrorSeverity.ERROR); + put(CICSLexer.TEMPLATERR, ErrorSeverity.ERROR); + put(CICSLexer.NOTSUPERUSER, ErrorSeverity.ERROR); + put(CICSLexer.CSDERR, ErrorSeverity.ERROR); + put(CICSLexer.DUPRES, ErrorSeverity.ERROR); + put(CICSLexer.RESUNAVAIL, ErrorSeverity.ERROR); + put(CICSLexer.CHANNELERR, ErrorSeverity.ERROR); + put(CICSLexer.CCSIDERR, ErrorSeverity.ERROR); + put(CICSLexer.TIMEDOUT, ErrorSeverity.ERROR); + put(CICSLexer.CODEPAGEERR, ErrorSeverity.ERROR); + put(CICSLexer.INCOMPLETE, ErrorSeverity.ERROR); + put(CICSLexer.APPNOTFOUND, ErrorSeverity.ERROR); + put(CICSLexer.BUSY, ErrorSeverity.ERROR); + } + }; + + public CICSHandleOptionsCheckUtility(DialectProcessingContext context, List errors) { + super(context, errors, DUPLICATE_CHECK_OPTIONS); + } + + /** + * Entrypoint to check CICS Handle rule options + * + * @param ctx ParserRuleContext subclass containing options + * @param A subclass of ParserRuleContext + */ + public void checkOptions(E ctx) { + switch (ctx.getRuleIndex()) { + case CICSParser.RULE_cics_handle_abend: + checkHandleAbend((CICSParser.Cics_handle_abendContext) ctx); + break; + case CICSParser.RULE_cics_handle_aid: + checkHandleAid((CICSParser.Cics_handle_aidContext) ctx); + break; + case CICSParser.RULE_cics_handle_condition: + checkHandleCondition((CICSParser.Cics_handle_conditionContext) ctx); + break; + default: + break; + } + checkDuplicates(ctx); + } + + @SuppressWarnings("unchecked") + private void checkHandleAbend(CICSParser.Cics_handle_abendContext ctx) { + checkHasMandatoryOptions(ctx.ABEND(), ctx, "ABEND"); + checkHasMutuallyExclusiveOptions("CANCEL or PROGRAM or LABEL or RESET", ctx.CANCEL(), ctx.PROGRAM(), ctx.LABEL(), ctx.RESET()); + } + + private void checkHandleAid(CICSParser.Cics_handle_aidContext ctx) { + checkHasMandatoryOptions(ctx.AID(), ctx, "AID"); + checkHasTooManyOptions(ctx); + } + + private void checkHandleCondition(CICSParser.Cics_handle_conditionContext ctx) { + checkHasMandatoryOptions(ctx.CONDITION(), ctx, "CONDITION"); + } + + private void checkHasTooManyOptions(ParserRuleContext parentCtx) { + List commandOoptions = parentCtx.children.stream() + .filter(node -> node instanceof TerminalNode) + .filter(node -> !node.getText().equalsIgnoreCase("AID")) + .collect(Collectors.toList()); + if (commandOoptions.size() > 16) { + throwException( + ErrorSeverity.ERROR, getLocality(parentCtx), "Too many options provided for: ", "HANDLE AID"); + } + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckBaseUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckBaseUtility.java index 6d075a4237..7de9e340ce 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckBaseUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckBaseUtility.java @@ -249,7 +249,7 @@ protected void checkResponseHandlers(CICSParser.Cics_handle_responseContext rule * @param Generic locality source type * @return The locality of the rule */ - protected Locality getLocality(E rule) { + protected Locality getLocality(E rule) { if (ParserRuleContext.class.isAssignableFrom(rule.getClass())) return VisitorUtility.constructLocality((ParserRuleContext) rule, context); else return VisitorUtility.constructLocality((TerminalNode) rule, context); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckUtility.java index d1bbb1b282..34ba02bf59 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSOptionsCheckUtility.java @@ -258,6 +258,9 @@ public CICSOptionsCheckUtility(DialectProcessingContext context, List[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlconalp.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ALPHABETIC-LOWER=The ALPHABETIC-LOWER class specifies that the data consists entirely of any combination of the lowercase Latin alphabetic characters a through z and the space.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpdscla.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -125,6 +128,7 @@ APPLMINORVER= APPLNAME= APPLNAMEST= APPLY= +APPNOTFOUND= AR= ARCHIVE= ARCHIVEFILE= @@ -296,6 +300,7 @@ BUNDLEPART= BURGEABILITY= BUSAPPMGR=Business applications manager BUSINESS_TIME= +BUSY= BUT= BXNUMBER= BY= @@ -327,10 +332,12 @@ CAST= CATALOG= CATALOG_NAME= CAUSE= +CBIDERR= CBL= CBLCARD= CBUFF= CCSID= +CCSIDERR= CCSID_ENCODING= CCSVERSION= CDSASIZE= @@ -349,6 +356,7 @@ CHANGES= CHANGETIME= CHANGEUSRID= CHANNEL= +CHANNELERR= CHAR= CHARACTER=The PADDING CHARACTER clause specifies a character to be used for block padding on sequential files.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rliospad.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CHARACTERS=The CHARACTERS keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -414,6 +422,7 @@ COBOLTYPE= CODE-SET=The CODE-SET clause specifies the character code used to represent data on a magnetic tape file.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfdecsc.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CODE= CODEPAGE= +CODEPAGEERR= CODEUNITS32= COLDSTATUS= COLLATE= @@ -496,6 +505,7 @@ CONSTRAINT= CONSTRAINTS= CONTAINER= CONTAINERCNT= +CONTAINERERR= CONTAINS=The CONTAINS keyword is part of the BLOCK CONTAINS and RECORD CONTAINS parameters of the DATA DIVISION.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfde.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CONTENT=The calling program passes only the contents of the literal or identifier.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tpshr03.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CONTENTS= @@ -558,6 +568,7 @@ CRLPROFILE= CROSS= CRUNCH= CS= +CSDERR= CTLCHAR= CUBE= CUME_DIST1= @@ -813,6 +824,7 @@ DIGITS= DIMENSIONS= DIRMGR= DISABLE= +DISABLED= DISABLEDACT= DISALLOW= DISCARD= @@ -878,11 +890,13 @@ DSNAME16= DSNAME= DSNAMELIST= DSNDB04= +DSNNOTFOUND= DSN_XMLVALIDATE= DSPLIST= DSRTPROGRAM= DSSCS= DSSIZE= +DSSTAT= DTIMEOUT= DTR= DTRPROGRAM= @@ -895,9 +909,11 @@ DUMPDS= DUMPID= DUMPING= DUMPSCOPE= +DUPKEY= DUPLICATE= DUPLICATES=The DUPLICATES keyword is a parameter for the ALTERNATE RECORD KEY clause and the SORT statement.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. DUPREC= +DUPRES= DURATION= DYN= DYNAM= @@ -946,7 +962,6 @@ ENABLEDCOUNT= ENABLESTATUS= ENCODING= ENCRYPTION= -ENCRYPTION= ENCRYPTKEY= ENCRYPT_DATAKEY= ENCRYPT_TDES= @@ -976,8 +991,10 @@ END=The END keyword has several functions.
[Search IBM documentation](https:/ ENDACTIVITY= ENDBR= ENDBROWSE= +ENDDATA= ENDFILE= ENDING= +ENDINPT= ENDOFDAY= ENDOFDAYHRS= ENDOFDAYMINS= @@ -989,6 +1006,7 @@ END_EXEC= ENFORCED= ENGLISH= ENQ= +ENQBUSY= ENQFAILS= ENQMODEL= ENQNAME= @@ -999,9 +1017,11 @@ ENTJAVA=Enterprise Java™ domain ENTRY=The ENTRY statement establishes an alternate entry point into a COBOL called subprogram.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsentr.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ENTRYNAME= ENTRYPOINT= +ENVDEFERR= ENVIRONMENT=In the ENVIRONMENT DIVISION of a program, you describe the aspects of the program that depend on the computing environment.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tppgm10.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. EOC= EODS= +EOF= EOP=When END-OF-PAGE is specified, and the logical end of the printed page is reached during execution of the WRITE statement, the END-OF-PAGE imperative-statement is executed.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpswrit.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. EP=Event processing domain EPADAPTER= @@ -1024,6 +1044,7 @@ EQUALCHAR= ERASE= ERASEAUP= ERDSASIZE= +ERROR= ERROR=The ERROR keyword can refer to the SIZE ERROR phrase and the EXCEPTION/ERROR declarative.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. ERRORMSG= ERRORMSGLEN= @@ -1039,6 +1060,7 @@ EUR= EVALUATE=The EVALUATE directive provides a multi-branch method of choosing the source lines to include in a compilation group.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rldireva.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. EVENT= EVENTBINDING= +EVENTERR= EVENTCAPTURE=Event capture EVENTMGR=Event manager EVENTNAME= @@ -1072,6 +1094,7 @@ EXITS= EXITTRACING= EXP= EXPECT= +EXPIRED= EXPIRYINT= EXPIRYINTMIN= EXPIRYTIME= @@ -1124,6 +1147,7 @@ FILE=The FILE keyword has several functions.
[Search IBM documentation](https FILECOUNT= FILELIMIT= FILENAME= +FILENOTFOUND= FILEPATH= FILLER=A data item that is not explicitly referred to in a program.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddelev.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. FILTERVALUE= @@ -1180,6 +1204,7 @@ FS= FSRT= FULL= FULLDATE= +FUNCERR= FUNCTION-ID=The FUNCTION-ID paragraph specifies the name by which the function is known and assigns selected function attributes to that function.
[Read more](https://www.ibm.com/docs/en/cobol-zos/6.4?topic=division-function-id-paragraph)
\u00A9 Copyright IBM Corporation 1994, 2024.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. FUNCTION-POINTER=The FUNCTION-POINTER phrase defines an item as a *function-pointer data item*. A function-pointer data item can contain the address of a procedure entry point.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddefnc.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. FUNCTION=A function-identifier is a sequence of character strings and separators that uniquely references the data item that results from the evaluation of a function.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlreffun.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -1304,15 +1329,20 @@ IF=The IF directive provides for a one-way or two-way conditional compilation.[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddeind.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -1379,7 +1409,10 @@ INTOCODEPAGE= INTSTATUS= INVALID=You can include an INVALID KEY phrase in READ, START, WRITE, REWRITE, and DELETE statements for VSAM indexed and relative files. The INVALID KEY phrase is given control if an input or output error occurs due to a faulty index key.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tperr16.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. INVALIDCOUNT= +INVERRTERM= +INVEXITREQ= INVITE= +INVLDC= INVMPSZ= INVOKE=The INVOKE statement can create object instances of a COBOL or Java™ class and can invoke a method defined in a COBOL or Java class.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsinvo.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. INVOKEBIND= @@ -1388,8 +1421,11 @@ INVOKERUN= INVOKETYPE= INVOKINGPROG= INVPARTN= +INVPARTNSET= INVREQ= +INVTSREQ= IO= +IOERR= IOTYPE= IPADDRESS= IPCONN: I P C O N N; @@ -1403,6 +1439,7 @@ IPFLISTSIZE= IPRESOLVED= IRC= IS= +ISCINVREQ= IS=Intersystem communication ISO= ISOLATEST= @@ -1411,6 +1448,7 @@ ISSUE= ISSUER= ISUSERID= ITEM= +ITEMERR= ITEMNAME= ITERATE= IUTYPE= @@ -1420,6 +1458,7 @@ JAR= JAVA= JAVAHOME= JCT= +JIDERR= JIS= JNIENVPTR=The JNIENVPTR special register references the Java Native Interface (JNI) environment pointer. The JNI environment pointer is used in calling Java callable services.
JNIENVPTR is implicitly defined as USAGE POINTER, and cannot be specified as a receiving data item.
[Read more](https://www.ibm.com/docs/en/cobol-zos/6.3?topic=registers-jnienvptr)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. JOBLIST= @@ -1507,6 +1546,7 @@ LEAST= LEAVE= LEAVEKB= LEFT=Specifies that the elementary item is to be positioned so that it will begin at the left character position of the natural boundary in which the elementary item is placed.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddesyn.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +LENGERR= LENGTH=The LENGTH function returns an integer equal to the length of the argument in national character positions for arguments of usage NATIONAL and in alphanumeric character positions or bytes for all other arguments. An alphanumeric character position and a byte are equivalent.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlinflen.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LENGTHLIST= LERUNOPTS= @@ -1532,6 +1572,7 @@ LINEADDR= LINECOUNT= LINES=DATA DIVISION parameter.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfde.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LINK= +LINKABEND= LINKAGE=The LINKAGE SECTION describes data made available from another program or method.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rldadls.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. LINKAUTH= LINKLEVEL= @@ -1547,6 +1588,7 @@ LM= LM=Lock manager LN= LOAD= +LOADING= LOADER=Program load manager LOADLIB= LOADPOINT= @@ -1706,6 +1748,7 @@ MMDDYYYY= MN=Monitoring manager MOD= MODE=The MODE keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +MODELIDERR= MODENAME= MODIFIED= MODIFIERS= @@ -1777,6 +1820,7 @@ NCNAME= NEGATIVE=Specifies a value less than 0.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpdssig.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. NETID= NETNAME= +NETNAMEIDERR= NETUOWID= NETWORK= NETWORKID= @@ -1837,6 +1881,7 @@ NODEBUG= NODECK= NODEFER= NODEHOME= +NODEIDERR= NODEJSAPP= NODENAME= NODIAGTRUNC= @@ -1868,6 +1913,7 @@ NOHANDLE= NOHOOK= NOINCONVERT= NOIO= +NOJBUFSP= NOKBD= NOLENGTH= NOLIB= @@ -1885,6 +1931,7 @@ NONE= NONTERMREL= NONUM= NONUMBER= +NONVAL= NOOBJ= NOOBJECT= NOOFF= @@ -1897,6 +1944,8 @@ NOOPTIONS= NOORDER= NOOUTCONERT= NOP= +NOPASSBKRD= +NOPASSBKWR= NOPFD= NOPROLOG= NOPRT= @@ -1914,27 +1963,37 @@ NOSEPARATE= NOSEQ= NOSEQUENCE= NOSOURCE= +NOSPACE= NOSPAN= NOSPIE= +NOSPOOL= NOSQL= NOSQLC= NOSQLCCSID= NOSRVCONVERT= NOSSR= NOSSRANGE= +NOSTART= NOSTDTRUNC= +NOSTG= NOSUSPEND= NOT=A logical or relational operator.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpdsabb.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +NOTALLOC= +NOTAUTH= NOTE= NOTERM= NOTERMINAL= NOTEST= +NOTFINISHED= +NOTFND= NOTHREAD= NOTIFICATION= NOTIFY= +NOTOPEN= NOTPURGEABLE= NOTRIG= NOTRUNCATE= +NOTSUPERUSER= NOUNDERSCORE= NOVBREF= NOWAIT= @@ -2027,6 +2086,7 @@ ONLY= OP= OPCLASS= OPEN=The OPEN statement initiates the processing of files. It also checks or writes labels, or both.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsopen.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +OPENERR= OPENSTATUS= OPERATION= OPERATOR= @@ -2074,6 +2134,7 @@ OUT= OUTCOME= OUTDD= OUTDESCR= +OUTDESCRERR= OUTER= OUTIN= OUTLINE= @@ -2083,6 +2144,7 @@ OUTPUT=Permits output operations.
[Read more](https://www.ibm.com/support/kno OUTTOKEN= OUTTOKENLEN= OVER= +OVERFLOW= OVERFLOW=Whether the ON OVERFLOW condition is raised for errors other than "out of storage" errors depends on the setting of the CMPR2/NOCMPR2 option.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/migrate/igymch1612.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. OVERLAPS= OVERLAY= @@ -2135,6 +2197,7 @@ PARTITIONSET= PARTITIONSST= PARTN= PARTNER= +PARTNERIDERR= PARTNFAIL= PARTNPAGE= PARTNS= @@ -2191,6 +2254,7 @@ PF9= PF= PFD= PFXLENG= +PGMIDERR= PG=Program manager PGMINTERFACE= PGMN= @@ -2225,6 +2289,7 @@ POINTER=A data item defined with USAGE IS POINTER is a *pointer data item*, or * POLICY= POLICYRULE= POOL= +POOLERR= POOLNAME= POP= PORT= @@ -2268,12 +2333,15 @@ PROCEDURE=The PROCEDURE DIVISION is an optional division.
[Read more](https:/ PROCEDURES=The ALL PROCEDURES phrase can be specified only once in a program. Only the procedures contained in the outermost program will trigger execution of the debugging section.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlcdsused.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. PROCEED=An optional keyword for the ALTER statement.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsalte.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. PROCESS=With the CBL (PROCESS) statement, you can specify compiler options to be used in the compilation of the program. The CBL (PROCESS) statement is placed before the IDENTIFICATION DIVISION header of an outermost program.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlcdscbl.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +PROCESSBUSY= +PROCESSERR= PROCESSING= PROCESSTYPE= PROCLENGTH= PROCNAME= PROFILE= PROFILEDIR= +PROFILEIDERR= PROGAUTO= PROGAUTOCTLG= PROGAUTOEXIT= @@ -2318,6 +2386,8 @@ PURGECYCLES= PURGETHRESH= PUSH= PUT= +QBUSY= +QIDERR= QNAME= QUALIFIER= QUALLEN= @@ -2335,6 +2405,7 @@ QUEUELIMIT= QUIESCESTATE= QUOTE=Represents one or more occurrences of the apostrophe or quotation mark characters.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rllancon.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. QUOTES=Represents one or more occurrences of the apostrophe or quotation mark characters.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rllancon.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +QZERO= RA=Resource manager adapters RADIANS= RAISE_ERROR= @@ -2369,6 +2440,7 @@ RECEIVER= RECFM= RECOMMEND= RECORD=The RECORD keyword has several functions.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +RECORDBUSY= RECORDFORMAT= RECORDING=The RECORDING MODE clause specifies the format of the physical records in a QSAM file. The clause is ignored for a VSAM file.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfdermc.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. RECORDLEN= @@ -2465,6 +2537,7 @@ RESETMDT= RESID= RESIDENCY= RESIDENT= +RESIDERR= RESIDLEN= RESIDLENGTH= RESIGNAL= @@ -2488,6 +2561,7 @@ RESTRICT= RESTYPE= RESULT= RESUME= +RESUNAVAIL= RESYNCMEMBER= RESYNCSTATUS= RETAIN= @@ -2495,6 +2569,7 @@ RETCODE= RETCORD= RETENTION= RETLOCKS= +RETPAGE= RETRIECE= RETRIEVAL= RETRIEVE= @@ -2530,6 +2605,7 @@ RMODE= ROLE= ROLELENGTH= ROLLBACK= +ROLLEDBACK= ROLLUP= ROTATE= ROUND= @@ -2562,8 +2638,10 @@ RRMS= RRN= RRS=Resource recovery services RS= +RTEFAIL= RS=Region status RTERMID= +RTESOME= RTIMEOUT= RTRANSID= RTRIM= @@ -2622,6 +2700,7 @@ SECURITY=Level of confidentiality of the program. An optional paragraph in the I SECURITYMGR= SECURITYNAME= SECURITYST= +SEGIDERR= SEGMENT-LIMIT=The SEGMENT-LIMIT clause is syntax checked but has no effect on the execution of the program.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlconobj.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. SEGMENT= SEGMENTLIST= @@ -2630,6 +2709,7 @@ SELECT=The SELECT clause identifies a file in the COBOL program to be associated SELECTIVE= SELECTIVITY= SELF= +SELNERR= SEND= SENDCOUNT= SENDER= @@ -2655,7 +2735,9 @@ SERVERPORT= SERVER_NAME= SERVICE= SERVSTATUS= +SESSBUSY= SESSION= +SESSIONERR= SESSIONS= SESSIONTYPE= SESSION_USER= @@ -2742,6 +2824,8 @@ SPECIFIC= SPECIFTCPS= SPIE= SPIST= +SPOLBUSY= +SPOLERR= SPOOLCLOSE= SPOOLOPEN= SPOOLREAD= @@ -2833,6 +2917,7 @@ STORES= STORIES= STOSPACE= STREAMNAME= +STRELERR= STRFIELD= STRING=The STRING statement strings together the partial or complete contents of two or more data items or literals into one single data item.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsstri.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. STRINGFORMAT= @@ -2880,6 +2965,7 @@ SUBTRACT=The SUBTRACT statement subtracts one numeric item, or the sum of two or SUM=The SUM function returns a value that is the sum of the arguments.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlinfsum.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. SUMMARY= SUPPRESS=Use the NOSUPPRESS option to ignore the SUPPRESS phrase of all COPY statements in a program so that copybook information can appear in the listing.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/custom/igycchsup.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +SUPPRESSED= SUSPEND= SUSPENDED= SUSPENDTIME= @@ -2889,6 +2975,7 @@ SUSPSTATUS= SWITCH= SWITCHSTATUS= SYMBOL= +SYMBOLERR= SYMBOLIC=The SYMBOLIC CHARACTERS clause is applicable only to single-byte character sets. Each character represented is an alphanumeric character.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlconsym.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. SYMBOLLIST= SYNC=The SYNCHRONIZED clause specifies the alignment of an elementary item on a natural boundary in storage.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlddesyn.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. @@ -2900,6 +2987,7 @@ SYNCPOINT= SYNCPOINTST= SYNONYM= SYSADM= +SYSBUSY= SYSCTRL= SYSDEFLT= SYSDUMPCODE= @@ -2907,6 +2995,7 @@ SYSDUMPING= SYSEIB= SYSIBM= SYSID= +SYSIDERR= SYSOPR= SYSOUTCLASS= SYSTEM= @@ -2937,6 +3026,7 @@ TASK= TASKDATAKEY= TASKDATALOC= TASKID= +TASKIDERR= TASKPRIORITY= TASKS= TASKSTARTST= @@ -2947,6 +3037,7 @@ TCB= TCBLIMIT= TCBS= TCEXITSTATUS= +TCIDERR= TCLASS= TCPIP= TCPIPJOB= @@ -2960,13 +3051,16 @@ TDQUEUE= TELLERID= TEMPLATE= TEMPLATENAME= +TEMPLATERR= TEMPLATETYPE= TEMPORAL= TEMPORARY= TEMPSTORAGE= TERM= TERMCODE= +TERMERR= TERMID= +TERMIDERR= TERMINAL=Use TERMINAL to send progress and diagnostic messages to the SYSTERM ddname.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ui/up2070.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. TERMINATE= TERMMODEL= @@ -2994,9 +3088,11 @@ THROUGH=THROUGH is a parameter in the PERFORM with TIMES phrase and the CLASS cl THRU=THRU is a parameter in the PERFORM with TIMES phrase and the CLASS clause.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. TI=Timer manager TIME=The conceptual data items DATE, DATE YYYYMMDD, DAY, DAY YYYYDDD, DAY-OF-WEEK, and TIME implicitly have USAGE DISPLAY. Because these are conceptual data items, they cannot be described in the COBOL program.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpsaccec.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +TIMEDOUT= TIMEOUT= TIMEOUTINT= TIMER= +TIMERERR= TIMES=The TIMES phrase can be specified in a PERFORM statement or an OCCURS clause.
[Search IBM documentation](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/welcome.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. TIMESEP= TIMESTAMP= @@ -3020,6 +3116,7 @@ TODAYS-DATE= TODAYS-NAME= TOFLENGTH= TOKEN= +TOKENERR= TOKENLEN= TOKENTYPE= TOLENGTH= @@ -3054,6 +3151,7 @@ TRANSACTION= TRANSCLASS= TRANSFORM= TRANSID= +TRANSIDERR= TRANSLATE= TRANSLATION= TRANSMODE= @@ -3075,6 +3173,7 @@ TRUNCATED= TRUNC_TIMESTAMP= TRUSTED= TS= +TSIOERR= TSMAININUSE= TSMAINLIMIT= TSMODEL= @@ -3126,6 +3225,8 @@ UOW= UOWDSNFAIL= UOWENQ= UOWLINK= +UOWLNOTFOUND= +UOWNOTFOUND= UOWSTATE= UP=When the format-2 SET statement is executed, the contents of the receiving field are increased by a value that corresponds to the number of occurrences represented by the value of identifier-3 or integer-2.
[Read more](https://www.ibm.com/support/knowledgecenter/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpssetb.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. UPDATE= @@ -3154,6 +3255,7 @@ USERAUTH= USERCORRDATA= USERDATAKEY= USERID= +USERIDERR= USERNAME= USERNAMELEN= USERPRIORITY= @@ -3199,6 +3301,7 @@ VFORMST= VIEW= VIRTUAL= VOLATILE= +VOLIDERR= VOLUME= VOLUMELENG= VOLUMES= @@ -3246,6 +3349,7 @@ WPMEDIA= WRAP= WRAPPED= WRAPPER= +WRBRK= WRITE-ONLY= WRITE=The WRITE statement releases a logical record to an output or input/output file.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlpswrit.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. WRITEQ= diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java new file mode 100644 index 0000000000..df069829c2 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCICSHandle.java @@ -0,0 +1,404 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.eclipse.lsp.cobol.usecases.common.CICSTestUtils; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Test CICS HANDLE commands. Documentation link: HANDLE Command + * + *

This class tests all variations of the HANDLE command: ABEND, AID, and CONDITION. + */ +public class TestCICSHandle { + private static final String HANDLE_ABEND_VALID = + "HANDLE ABEND PROGRAM({$varOne})"; + + private static final String HANDLE_ABEND_INVALID = + "HANDLE {CANCEL|errorOne}"; + + private static final String HANDLE_AID_VALID_ONE = + "HANDLE AID ANYKEY({@SEC1})"; + + private static final String HANDLE_AID_VALID_TWO = + "HANDLE AID PF1({@SEC1})"; + + private static final String HANDLE_AID_INVALID = + "HANDLE {_ANYKEY({@SEC1})|errorOne_}"; + + private static final String HANDLE_AID_VALID_THREE = + "HANDLE AID PF1({@SEC1}) PF3"; + + private static final String HANDLE_AID_INVALID_TWO = + "HANDLE {_AID CLEAR CLRPARTN ENTER OPERID ANYKEY PA1 PF1({@SEC1}) TRIGGER LIGHTPEN PA2 " + + "PA3 PF2 PF3 PF4 PF5 PF6 PF7 PF8 PF9 PF10 PF11|errorOne_}"; + + private static final String HANDLE_CONDITION_VALID = + "HANDLE CONDITION EOC({@SEC1})"; + + private static final String HANDLE_CONDITION_VALID_ONE = + "HANDLE CONDITION ERROR"; + + + private static final String HANDLE_CONDITION_VALID_TWO = + "HANDLE CONDITION"; + + + private static final String HANDLE_CONDITION_INVALID_ONE = + "HANDLE {ERROR|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_TWO = + "HANDLE CONDITION {CONDITION|errorOne} ERROR"; + + private static final String HANDLE_CONDITION_INVALID_THREE = + "HANDLE CONDITION NORMAL {NORMAL|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_WRBRK = + "HANDLE CONDITION WRBRK {WRBRK|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_INBFMH = + "HANDLE CONDITION INBFMH {INBFMH|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_ENDINPT = + "HANDLE CONDITION ENDINPT {ENDINPT|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_NONVAL = + "HANDLE CONDITION NONVAL {NONVAL|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_NOSTART = + "HANDLE CONDITION NOSTART {NOSTART|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_TERMIDERR = + "HANDLE CONDITION TERMIDERR {TERMIDERR|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_FILENOTFOUND = + "HANDLE CONDITION FILENOTFOUND {FILENOTFOUND|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_NOTFND = + "HANDLE CONDITION NOTFND {NOTFND|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_DUPKEY = + "HANDLE CONDITION DUPKEY {DUPKEY|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_INVREQ = + "HANDLE CONDITION INVREQ {INVREQ|errorOne}"; + + private static final String HANDLE_CONDITION_INVALID_IOERR = + "HANDLE CONDITION IOERR {IOERR|errorOne}"; + + @Test + void testHandleAbendValid() { + CICSTestUtils.noErrorTest(HANDLE_ABEND_VALID); + } + + @Test + void testHandleAbendInvalid() { + UseCaseEngine.runTest( + getTestString(HANDLE_ABEND_INVALID), + ImmutableList.of(), + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: ABEND", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleAidValidOne() { + UseCaseEngine.runTest(getTestString(HANDLE_AID_VALID_ONE), ImmutableList.of(), ImmutableMap.of()); + } + + @Test + void testHandleAidValidTwo() { + UseCaseEngine.runTest(getTestString(HANDLE_AID_VALID_TWO), ImmutableList.of(), ImmutableMap.of()); + } + + @Test + void testHandleAidInvalid() { + UseCaseEngine.runTest( + getTestString(HANDLE_AID_INVALID), + ImmutableList.of(), + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: AID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleAidValidThree() { + UseCaseEngine.runTest(getTestString(HANDLE_AID_VALID_THREE), ImmutableList.of(), ImmutableMap.of()); + } + + @Test + void testHandleAidInvalidThree() { + UseCaseEngine.runTest( + getTestString(HANDLE_AID_INVALID_TWO), + ImmutableList.of(), + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Too many options provided for: HANDLE AID", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionValid() { + UseCaseEngine.runTest(getTestString(HANDLE_CONDITION_VALID), ImmutableList.of(), ImmutableMap.of()); + } + + @Test + void testHandleConditionValidOne() { + CICSTestUtils.noErrorTest(HANDLE_CONDITION_VALID_ONE); + } + + @Test + void testHandleConditionValidTwo() { + CICSTestUtils.noErrorTest(HANDLE_CONDITION_VALID_TWO); + } + + @Test + void testHandleConditionInvalidOne() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_ONE, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Missing required option: CONDITION", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidTwo() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_TWO, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: CONDITION", + DiagnosticSeverity.Warning, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidThree() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_THREE, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NORMAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidWrbrk() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_WRBRK, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: WRBRK", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidInbfmh() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_INBFMH, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: INBFMH", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidEndinpt() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_ENDINPT, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: ENDINPT", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidNonval() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_NONVAL, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NONVAL", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidNostart() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_NOSTART, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NOSTART", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidTermiderr() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_TERMIDERR, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: TERMIDERR", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidFilenotfound() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_FILENOTFOUND, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: FILENOTFOUND", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidNotfnd() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_NOTFND, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: NOTFND", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidDupkey() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_DUPKEY, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: DUPKEY", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidInvreq() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_INVREQ, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: INVREQ", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + @Test + void testHandleConditionInvalidIoerr() { + CICSTestUtils.errorTest( + HANDLE_CONDITION_INVALID_IOERR, + ImmutableMap.of( + "errorOne", + new Diagnostic( + new Range(), + "Excessive options provided for: IOERR", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } + + private static final String BASE_TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. ABCDEF.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " 01 {$*varOne} PIC S9 VALUE +10.\n" + + " 01 {$*varTwo} PIC S9 VALUE +100.\n" + + " 01 {$*varThree} PIC S9 VALUE +1000.\n" + + " 01 {$*varFour} PIC X VALUE 'NAME_ONE'.\n" + + " 01 {$*varFive} PIC X VALUE 'NAME_TWO'.\n" + + " 01 {$*varSix} PIC X VALUE 'NAME_THREE'.\n" + + " PROCEDURE DIVISION.\n" + + " EXEC CICS \n" + + " END-EXEC.\n" + + " {@*SEC1} SECTION.\n" + + " DISPLAY \"Text: \".\n"; + + private String getTestString(String components, String... compilerOptions) { + List instances = Arrays.asList(components.split("\\s")); + instances.replaceAll(String.join("", Collections.nCopies(12, " "))::concat); + List compilerOptionsList = + Arrays.stream(compilerOptions) + .map(compilerOption -> compilerOption = " CBL CICS(\"" + compilerOption + "\")") + .collect(Collectors.toList()); + + ArrayList base = new ArrayList(Arrays.asList(BASE_TEXT.split("\n"))); + base.addAll(0, compilerOptionsList); + base.addAll(base.size() - 3, instances); + return String.join("\n", base); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java index 54cfe22b59..005079604f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCicsExciGetContainerStatement.java @@ -36,7 +36,7 @@ public class TestCicsExciGetContainerStatement { + "\n" + " PROCEDURE DIVISION.\n" + " EXEC CICS HANDLE CONDITION \n" - + " ERRORS \n" + + " ERROR \n" + " RESP({$RETURN-CODE})\n" + " END-EXEC.\n" + "\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java index a7768fa289..0fd1edef76 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecCicsHandleAidClear.java @@ -35,7 +35,7 @@ class TestExecCicsHandleAidClear { + " {#*10-EXIT}.\n" + " EXIT.\n" + " {#*NACT}.\n" - + " EXEC CICS HANDLE AID CLEAR() END-EXEC.\n" + + " EXEC CICS HANDLE AID CLEAR END-EXEC.\n" + " EXEC CICS HANDLE AID CLEAR({#10-EXIT}) END-EXEC.\n"; @Test From f3f259f7a672cf37611a20bed8f3d134084776ad Mon Sep 17 00:00:00 2001 From: ilidio-lopes Date: Thu, 9 Jan 2025 14:50:29 +0100 Subject: [PATCH 2/2] Update server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java Co-authored-by: slavek-kucera <53339291+slavek-kucera@users.noreply.github.com> --- .../cics/utility/CICSHandleOptionsCheckUtility.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java index 6ee8bee75f..490c81eac9 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/cics/utility/CICSHandleOptionsCheckUtility.java @@ -246,11 +246,14 @@ private void checkHandleCondition(CICSParser.Cics_handle_conditionContext ctx) { } private void checkHasTooManyOptions(ParserRuleContext parentCtx) { - List commandOoptions = parentCtx.children.stream() + if (parentCtx.children == null) + return; + long commandOptionsCount = parentCtx.children.stream() .filter(node -> node instanceof TerminalNode) - .filter(node -> !node.getText().equalsIgnoreCase("AID")) - .collect(Collectors.toList()); - if (commandOoptions.size() > 16) { + .map(TerminalNode.class::cast) + .filter(node -> node.getSymbol().getType() != CICSLexer.AID) + .count(); + if (commandOptionsCount > 16) { throwException( ErrorSeverity.ERROR, getLocality(parentCtx), "Too many options provided for: ", "HANDLE AID"); }