For integrate submit JCL and compile with Vim, we need some pre-works:
1. One shell script: use ftp and site command to submit JCL to jes, we call it ftpwj.sh, JCL file name is passed as parameter.
2. One shell script: generate JCL for compile programs, the compile mode and program name can be passed to shell as parameters. We call it comp2jes.sh
Use shc compile the two scripts to executable files, and move them to folder which in $PATH.
Now we can use vim's scirpt to call these executable files to submit JCL or compile programs:
Submit JCL:
1
function
! SubmitJCL(
...
)
"{{{
2
if
&ft==
"jcl"
3
let
s:sourceFile=
substitute
(
expand
(
"%"
)
,"
//
"
,"/"
,"g"
)
4
else
5
echohl
ErrorMsg
| echo
"Not a JCL file"
|
echohl
NONE
6
return
7
endif
8
if
a:0
==
1
9
let
s:siteSys =
a:1
10
if
s:siteSys ==
"w"
11
exec
"silent !ftpwj put "
.
s:sourceFile
12
elseif
s:siteSys ==
"q"
13
exec
"silent !ftpqj put "
.
s:sourceFile
14
endif
15
else
16
exec
"silent !ftpwj put "
.
s:sourceFile
17
endif
18
endfunction
"}}}
JCL file is the parameter passed to function SubmitJCL and then passed to ftpwj.exe, ftpwj.exe will put it to JES.
ftpqj is another application like ftpwj, they can send JCL to diffrent server.
Compile programs:
20
function
! CompFile(
...
)
"{{{
21
if
&ft==
"pli"
22
let
s:sourceFile=
substitute
(
expand
(
"%"
)
,"
//
"
,"/"
,"g"
)
23
else
24
echohl
ErrorMsg
| echo
"Not a source file"
|
echohl
NONE
25
return
26
endif
27
if
a:0
==
1
28
let
s:sourceType =
a:1
29
call
FtpMput
()
30
if
s:sourceType ==
"bat"
31
exec
"!comp2jes "
.
s:sourceFile .
" BAT"
32
elseif
s:sourceType ==
"onl"
33
exec
"!comp2jes "
.
s:sourceFile .
" ONL"
34
endif
35
else
36
echohl
ErrorMsg
| echo
"Parameter needed"
|
echohl
NONE
37
endif
38
endfunction
"}}}
BAT or ONL is the compilation mode as parm transfer to comp2jes.
Program name also is one parm. Here call FtpMput function to transfer source to server then compile.

本文介绍如何通过Vim集成提交JCL作业并编译程序的方法。主要涉及两个shell脚本:一是使用ftp命令提交JCL到作业管理系统;二是生成用于编译程序的JCL。同时,文中提供了具体的Vim脚本示例,演示了如何根据不同文件类型调用相应的脚本。

被折叠的 条评论
为什么被折叠?



