A Mainframe IDE Powered By Unix Technology [12] - Integrate submit JCL and compile with Vim

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值