Skip to content

Cics get64 container improvements v2 #2695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ GDS : G D S;
GENERIC : G E N E R I C;
GENERICTCPS : G E N E R I C T C P S;
GET : G E T;
GET64 : G E T '6' '4';
GETMAIN : G E T M A I N;
GETMAIN64 : G E T M A I N '6' '4';
GETNEXT : G E T N E X T;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ cics_freemain: (FREEMAIN | FREEMAIN64) cics_freemain_opts;
cics_freemain_opts:(DATA cics_data_area | DATAPOINTER cics_value | cics_handle_response)+;

/** GET CONTAINER / GET COUNTER / GET DCOUNTER */
cics_get: GET (cics_get_container_bts | cics_get_container_channel | cics_get_counter_dcounter);
cics_get: (GET (cics_get_container_bts | cics_get_counter_dcounter)) | (GET|GET64) cics_get_container_channel;
cics_get_container_bts: ((CONTAINER | ACTIVITY) cics_data_value | ACQACTIVITY | PROCESS | ACQPROCESS | (INTO | FLENGTH) cics_data_area |
SET cics_ref | NODATA | cics_handle_response)*;
cics_get_container_channel: ((CONTAINER | CHANNEL | BYTEOFFSET | INTOCCSID | INTOCODEPAGE) cics_data_value | (INTO | FLENGTH | CCSID) cics_data_area |
Expand Down Expand Up @@ -1753,6 +1753,7 @@ ABCODE
| GENERIC
| GENERICTCPS
| GET
| GET64
| GETMAIN
| GETMAIN64
| GETNEXT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class CICSGetOptionsCheckUtility extends CICSOptionsCheckBaseUtility {
private static final Map<Integer, ErrorSeverity> DUPLICATE_CHECK_OPTIONS =
new HashMap<Integer, ErrorSeverity>() {
{
put(CICSLexer.GET, ErrorSeverity.ERROR);
put(CICSLexer.CONTAINER, ErrorSeverity.ERROR);
put(CICSLexer.ACTIVITY, ErrorSeverity.ERROR);
put(CICSLexer.ACQACTIVITY, ErrorSeverity.WARNING);
Expand Down Expand Up @@ -101,6 +100,9 @@ private void checkContainerBTS(CICSParser.Cics_get_container_btsContext ctx) {

@SuppressWarnings("unchecked")
private void checkContainerChannel(CICSParser.Cics_get_container_channelContext ctx) {
CICSParser.Cics_getContext parentCtx = (CICSParser.Cics_getContext) ctx.getParent();
checkHasIllegalOptions(parentCtx.GET64(), "GET64 is only available in Assembly");

checkHasMandatoryOptions(ctx.CONTAINER(), ctx, "CONTAINER");
checkHasExactlyOneOption("INTO or SET or NODATA", ctx, ctx.INTO(), ctx.SET(), ctx.NODATA());
if (!ctx.BYTEOFFSET().isEmpty() || !ctx.SET().isEmpty() || !ctx.NODATA().isEmpty()) {
Expand Down
1 change: 1 addition & 0 deletions server/engine/src/main/resources/LanguageKeywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,7 @@ GENERATE_UNIQUE_BINARY=
GENERIC=
GENERICTCPS=
GET=
GET64=
GETHINT=
GETMAIN64=
GETMAIN=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ public class TestCICSGet {
"GET CONTAINER({$varOne}) CHANNEL({$varTwo}) INTO({$varThree}) FLENGTH({$varFour})";

private static final String CONTAINER_CHANNEL_VALID_TWO =
"GET CONTAINER({$varOne}) INTO({$varTwo}) INTOCCSID({$varThree})";
"GET CONTAINER({$varOne}) INTO({$varTwo}) INTOCCSID({$varThree})";

private static final String CONTAINER_CHANNEL_INVALID_ONE =
"GET CONTAINER(100) {CONTAINER|errorTwo}(100) INTO({$varFour})";

private static final String CONTAINER_CHANNEL_INVALID_TWO =
"GET CONTAINER(10) INTO({$varFour}) {INTOCCSID|errorOne}(100) {INTOCODEPAGE|errorTwo}(100)";

private static final String CONTAINER_CHANNEL_INVALID_THREE =
"{GET64|errorOne} CONTAINER({$varOne}) INTO({$varTwo}) INTOCCSID({$varThree})";

private static final String COUNTER_VALID_ONE =
"GET COUNTER({$varOne}) POOL({$varTwo}) VALUE({$varThree}) INCREMENT({$varFour}) WRAP";

Expand Down Expand Up @@ -164,6 +167,19 @@ void testContainerChannelInvalidTwo() {
ErrorSource.PARSING.getText())));
}

@Test
void testContainerChannelInvalidThree() {
CICSTestUtils.errorTest(
CONTAINER_CHANNEL_INVALID_THREE,
ImmutableMap.of(
"errorOne",
new Diagnostic(
new Range(),
"Invalid option provided: GET64 is only available in Assembly",
DiagnosticSeverity.Error,
ErrorSource.PARSING.getText())));
}

@Test
void testCounterValidOne() {
CICSTestUtils.noErrorTest(COUNTER_VALID_ONE);
Expand Down
Loading