cschneid-the-elder / mapa Goto Github PK
View Code? Open in Web Editor NEWmainframe application portfolio analysis, antlr4 grammars and java for static analysis of cobol+cics+db2, jcl
License: MIT License
mainframe application portfolio analysis, antlr4 grammars and java for static analysis of cobol+cics+db2, jcl
License: MIT License
I get following message at parsing a small (SQL) COBOL program at running the CobolTree under OMVS:
"[Tue Mar 29 08:48:42 GMT+01:00 2022] INFO: getprml0.cob not COBOL?"
I can run the same parsing under Windows for the program without any error.
Another question for the same running environment: how can I define the -file parameter for an OMVS file?
My guess was something like -file "//'my-mvs-file'"
...but the file name was not recognized by the app.
Hi
Thanks for providing such a good Antlr Grammar for JCL
I'm just getting started of Grammar Parsing or Antlr4,
When I tried to get a Grammar Tree with JCLParser & JCLLexer , there are some Errors.
Mostly cause of [channels] statement at JCLLexer.g4 file
I've gooled and been told [channels] statement is not for all versions of Antlr4,
I'm using 4.7.1 , Is that the reason ?
Here is the Error Details:
Multiple markers at this line
- parser rule 'channels' not allowed in lexer
- missing RULE_COLON at '{ COMMENTS }'
Hi,
i'm using the JCL parser to convert a set of files containing JCL to csv format. Not all input files contains a valid jcl and i the program halt with the error below.
Is there any way to log the errors without halting?
Thanks.
Parser error line 128:11 mismatched input 'EXEC' expecting JOB
Parser rule stack: [startRule, jcl, execJCL, jobCard]
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.antlr.v4.runtime.tree.TerminalNode.getSymbol()" because the return value of "JCLPPParser$JobCardContext.JOB()" is null
at PPListener.enterJobCard(PPListener.java:66)
at JCLPPParser$JobCardContext.enterRule(JCLPPParser.java:4975)
at org.antlr.v4.runtime.tree.ParseTreeWalker.enterRule(ParseTreeWalker.java:50)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:33)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at Demo01.lexAndParsePP(Demo01.java:260)
at Demo01.main(Demo01.java:83)
Hi, Do you have an Antlr4 parser/lexer for Linux Shell ?
KShell is the best.
BTW, thanks for providing JCL Parser 2 years ago,
It's very very helpful.
Hi,
I am wondering if it is at all possible to see more than one level deep for JCL files? Ie:
Imagining you have a JCL Proc named PROC001 that calls out to another PGM called FORMATPGM:
//PROC001 PROC
//**********************************************************************
//* S030 S040 - DELETE LAST RUN'S DATA FILES
//**********************************************************************
//*
//S030 EXEC PGM=DELPROG,
// PARM='GEN.CMP.DP.WEEKLY'
//S040 EXEC PGM=DELPROG,
// PARM='GEN.CMP.DP.WEEKLY'
//*
//**********************************************************************
//* S050 - REFORMAT THE COMMA DELIMITED DP EXTRACT
//**********************************************************************
//S050 EXEC PGM=FORMATPGM
//INP01 DD DSN=GEN.CMP.DS.FOO.WEEKLY,
// DISP=SHR
//OUT01 DD DSN=GEN.CMP.DP.WEEKLY.FALL,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(50,50),RLSE),
// RECFM=FB,LRECL=600,AVGREC=K
//**********************************************************************
//* S060 - REFORMAT THE COMMA DELIMITED DP EXTRACT
//**********************************************************************
//S060 EXEC PGM=FORMATPGM
//INP01 DD DSN=GEN.CMP.DS.BAR.WEEKLY,
// DISP=SHR
//OUT01 DD DSN=GEN.CMP.DP.WEEKLY.BAZ,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(50,50),RLSE),
// RECFM=FB,LRECL=600,AVGREC=K
And the FORMATPGM file looks like the following:
******************************************************************
******************************************************************
IDENTIFICATION DIVISION.
******************************************************************
******************************************************************
PROGRAM-ID. FORMATPGM.
AUTHOR. AUTHOR NAME
INSTALLATION. GENERIC ORGANIZATION.
DATE-WRITTEN. MM/DD/YY.
DATE-COMPILED.
******************************************************************
* Changes and updates are noted here with generic descriptions. *
******************************************************************
******************************************************************
ENVIRONMENT DIVISION.
******************************************************************
******************************************************************
CONFIGURATION SECTION.
******************************************************************
SOURCE-COMPUTER. GENERIC-COMPUTER.
OBJECT-COMPUTER. GENERIC-COMPUTER.
******************************************************************
INPUT-OUTPUT SECTION.
******************************************************************
FILE-CONTROL.
SELECT INPUT-FILE
ASSIGN TO INP01.
SELECT OUTPUT-FILE
ASSIGN TO OUT01.
******************************************************************
DATA DIVISION.
******************************************************************
******************************************************************
FILE SECTION.
******************************************************************
FD INPUT-FILE
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS.
01 INPUT-FORMAT-RECORD PIC X(600).
FD OUTPUT-FILE
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS.
01 OUTPUT-FORMAT-RECORD PIC X(600).
******************************************************************
WORKING-STORAGE SECTION.
******************************************************************
01 WS-PROGRAM-CONTROL.
05 WS-END-OF-INPUT-FLAG PIC X(01) VALUE 'N'.
88 WS-END-OF-INPUT VALUE 'Y'.
01 WS-VARIABLES.
05 WS-INPUT-DATA PIC X(600).
01 WS-OUTPUT-DATA.
05 WS-DATA1 PIC X(18).
...
05 WS-DATA27 PIC X(18) VALUE SPACES.
******************************************************************
******************************************************************
PROCEDURE DIVISION.
******************************************************************
******************************************************************
MAIN-LOGIC.
PERFORM INITIALIZE-PROCESS.
PERFORM PROCESS-LOOP UNTIL WS-END-OF-INPUT.
PERFORM WRAP-UP.
STOP RUN.
INITIALIZE-PROCESS.
OPEN INPUT INPUT-FILE.
OPEN OUTPUT OUTPUT-FILE.
PERFORM READ-INPUT-RECORD.
PROCESS-LOOP.
UNSTRING WS-INPUT-DATA DELIMITED BY ","
INTO WS-DATA1, ..., WS-DATA27.
INSPECT WS-OUTPUT-DATA REPLACING ALL X'0D' BY X'40'.
WRITE OUTPUT-FORMAT-RECORD FROM WS-OUTPUT-DATA.
PERFORM READ-INPUT-RECORD.
WRAP-UP.
CLOSE INPUT-FILE OUTPUT-FILE.
READ-INPUT-RECORD.
READ INPUT-FILE INTO WS-INPUT-DATA
AT END SET WS-END-OF-INPUT TO TRUE.
I have provided the -include PATH.TO.FOLDER.CONTAINING.FORMATPGM
in the command:
java -jar jcl/JCLParser.jar -include ../PATH.TO.FOLDER.CONTAINING.FORMATPGM -file ../PROCLIB/PROC001 -outtree PROC001.proclib.tsv -outcsv PROC001.proclib.csv -logLevel FINEST -saveTemp
The output from running this, namely the PROC001.proclib.tsv, looks like the following:
1 │
2 │ PROC001
3 │ S030 1 PGM DELPROG
4 │ S040 2 PGM DELPROG
5 │ S050 3 PGM FORMATPGM
6 │ S060 4 PGM FORMATPGM
I was anticipating that FORMATPGM's definition would be parsed and unfurled in the tree as well, but it seems as though that may not be supported, at least for this given invocation of the JCL jar. Is there some way to get the parser to output an outtree that resolves the FORMATPGM tree, and any programs IT calls as well?
Thanks in advance!
mapa/db2z/src/DB2zSQLParser.g4
Line 2574 in 57b58b4
alterIndexOptions references 1 time the usingSpecification1.
This means a 1-time call being a "using stogroup" OR a secqty OR erase OR priqty. But it should be a loop ... hence it should reference the usingBlock clause.
mapa/db2z/src/DB2zSQLParser.g4
Line 3221 in 57b58b4
The change made on the createTablespaceOptionList (change the usingBlock to usingSpecification2) should also be implemented at location mentioned above.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.