mikefultondev / jclparser Goto Github PK
View Code? Open in Web Editor NEWJCL to script generate
License: Other
JCL to script generate
License: Other
See: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/conditional.skipjcl for an example
See https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/include.skipjcl for an example
Here is a diff:
< //DRVRCHKF IF (DRVRCHK.RC ^=0) THEN SEND FAILURE NOTE
---
> //DRVRCHKF IF (DRVRCHK.RC ^=0) THEN
52c52
< //COPY1OK IF (DRVRCHK.RC = 0) THEN COPY FIRST PACK
---
> //COPY1OK IF (DRVRCHK.RC = 0) THEN
62c62
< //COPY1F IF (COPY1.RC ^= 0) THEN SEND FAILURE NOTE
---
> //COPY1F IF (COPY1.RC ^= 0) THEN
120c120
< //CTIMEOUT IF (RESUBEX.RC ^=0) THEN SEND FINAL FAILURE NOTE
---
> //CTIMEOUT IF (RESUBEX.RC ^=0) THEN
Run jcl2jcl on https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/parmcomments.skipjcl with -v and you will see:
000000001 //IBMUSERC JOB 'CRTHFS' Job Card |
-> JOB Statement
000000002 //STEP1 EXEC PGM=IEFBR14, |
-> EXEC Statement
--> continued parameter
000000003 //* Comment |
000000004 // PARM='Hello World' |
//IBMUSERC JOB 'CRTHFS' Job Card
//STEP1 EXEC PGM=IEFBR14,
Comment
// PARM='Hello World'
The comment is not being properly printed. Note that for this case, the comment is in the tree - here's a screen shot:
but note the newline at the start... So the 'printer' in genJCL could likely deal with this (should validate multi-line comments too).
Also: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/odd.skipjcl and https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/commented.skipjcl
See: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/inlinedd.skipjcl for an example, specifically:
zzStuff Here Ignored
is displayed as:
zz
Mike, good day, a question, the sample in the README.MD:
jcl2sh <//'IBMUSER.TEST.JCL(UPDATE) >./update.sh
It don't send any message and neither create the update.sh ...
could you comment some action to verify the shell?
right now, jcl2sh only has the scanner written to scan the JCL and create an internal representation. Generators need to be written for the output side.
The compilation is generating a CCN3046 "sintax error" in line 707 of scanjcl.c program->
KeyValuePair_T* kvp = cur->kvphead;
to eliminate this error, I fixed it adding an->"else {", in line 606 and other->"}" just before the line 743
and then the compilation was ok! and it generates the module jcl2sh in the bin directory ,... but
The problem is at execution time of the jcl2sh to generate the shell, it does not do anything!...
jcl2sh <//'IBMUSER.TEST.JCL(UPDATE) >./update.sh
do you know, what is happening? or an idea or suggestion to fix this situation?
Is it correct the sintax of the execution jcl2sh? is it missing something else?
Thanks a lot for your help!
See: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/cancel.skipjcl for an example
See: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/cntl.skipjcl for an example
From Arturo:
I found some mistakes with the characters conversion,... for example the compiler is not accepting “!” , “[“, “]”
Not sure what other examples there are, but the jobcard in: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/longcard.jcl
has:
//IXCLARM JOB 'D7103P,D71,?,S=I'
which confuses the parser because it isn't expecting a string for the 'name', e.g. it is normally something like:
//STEP EXEC PGM=FRED,PARM='<string>'
so the key value is a string (but in the first case the key name is a string).
Hi @mikefultonbluemix ,
Please advice to me how to fix and run your source code?
Some info for your reference as below:
step 1: clone source and save my server.
step 2: create 2 folder
JCL2SH_SOURCE: save source code here
JCL2SH: empty
step 2:
cd to the directory (/u/ibmuser/JCL2SH) = /home/JCL2SH_SOURCE
edit setenv.sh to point to the various MVS programs that will be tested, and to specify where your code was copied to
=>export JCL2SH_ROOT=/home/JCL2SH
step 3:
create folder bin into folder /home/JCL2SH_SOURCE
step 4:
sh build.sh
please see result as below error:
[root@cock-01 JCL2SH]# sh build.sh
Build Default Version
gcc: error: unrecognized command line option ‘-Wc,FLAG(I)’
gcc: error: unrecognized command line option ‘-Wc,xplink,gonum,offset,langlvl(extended),list(./)’
gcc: error: unrecognized command line option ‘-Wc,FLAG(I)’
gcc: error: unrecognized command line option ‘-Wc,xplink,gonum,offset,langlvl(extended),list(./)’
gcc: error: unrecognized command line option ‘-Wc,FLAG(I)’
gcc: error: unrecognized command line option ‘-Wc,xplink,gonum,offset,langlvl(extended),list(./)’
gcc: error: unrecognized command line option ‘-Wc,FLAG(I)’
gcc: error: unrecognized command line option ‘-Wc,xplink,gonum,offset,langlvl(extended),list(./)’
gcc: error: unrecognized command line option ‘-Wc,FLAG(I)’
gcc: error: unrecognized command line option ‘-Wc,xplink,gonum,offset,langlvl(extended),list(./)’
gcc: error: jcl2sh.o: No such file or directory
gcc: error: scanjcl.o: No such file or directory
gcc: error: gensh.o: No such file or directory
gcc: error: jclargs.o: No such file or directory
gcc: error: jclmsgs.o: No such file or directory
Please advice to how to run your source and document guilde step by step. Thanks for the support.
Thanks and best regards,
Nho Luong.
See: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/multiLine.skipjcl which has a multi-line comment at the end of the JCL
See: multiLine.jcl which has a multi-line string on it.
simple fix is to cut everything to the right of column 71, but 'information' is lost.
See: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/longcard.skipjcl
and https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/multilinejob.skipjcl for examples
% ../bin/jcl2sh --input=./inlineGeneratedSYSIN.jcl --output=./inlineGeneratedSYSIN.jcl.sh
zsh: segmentation fault ../bin/jcl2sh --input=./inlineGeneratedSYSIN.jcl
205c205
< // ENDIF /*ENDIF FOR THE IF STARTED AT STEPN007*/
---
> // ENDIF
and
51c51
< //DOIT ELSE /*DG 04092012 FOR REQ C243
---
> //DOIT ELSE
56c56
< //DOIT ENDIF /*DG 04092012 FOR REQ C243
are two examples
For the following test: https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/gensysin.skipjcl and
https://github.com/MikeFultonDev/JCLParser/blob/main/testsrc/inlineGeneratedSYSIN.skipjcl
the output has an extra line - it explicitly shows the otherwise implicit SYSIN DD card:
//IBMUSER JOB ,MSGLEVEL=(1,1)
//STEP EXEC PGM=IEFBR14
//SYSIN DD * (Generated)
Line A
Line B
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.