Here use PLI as example: 2 choices to integete compile results with vim:
.
1. Compile source on Mainframe then use XDC command to save results into dataset or use ftp and site command to fetch result from job's sysout. After this we can reformat result and integrate with vim.
I already introduced that, first use one shell to reformat result that vim can read it, then use vim command to open error file in quickfix window.
2. Compile local file with Rational developer for System z(RDZ), this is much more fast than option 1.
.
Today, I will show you how to compile with RDZ.
.
You can download RDZ from ibm.com for 50 days' trial version. After installation, add X:/Program Files/IBM/SPD/bin/ into enviroment variable PATH. Then you can call pli.exe to compile pli source in command window with this format:
pli.exe file_name.pli (Compile time option
In order to integrate with vim, do the steps bellow:
1. Change $VIMRUNTIME/compiler/pli.vim:
let current_compiler = "pli" “compiler type
CompilerSet makeprg=rdzpli.exe "shell script to call pli.exe and pass compile time option to pli.exe
CompilerSet errorformat=%f.pli(%l:2)/ :/ IBM%nI/ %t/ %m "error message file format
.
2.Create one shell script "rdzpli.sh" and use shc compile as executable file, then move to Cygwin/bin.
So we can call rdzpli to compile pli source:
rdzpli filename or rdzpli -i filename to throw out information level's msg.
#!/bin/sh #Function: Compile pli program by Rdz pli.exe #Author : Ricky Wu <Richiewu At Live Dot Com> #Version : USAGE="Usage:pli FileName" quit() { exit $1 } inFile=$1 if [ $# -lt 1 ] then echo $USAGE exit 1 elif [ $# -eq 1 ] then if [ ! -f ${inFile} ] then echo "File dose not exsits." quit 1 fi cp $inFile ${inFile}.pli pli.exe ${inFile}.pli /(include /(ext/(/' /',Inc,Cpy/)/) else while getopts i OPTION do case $OPTION in i)inFile=$2 if [ ! -f ${inFile} ] then echo "File dose not exsits." quit 1 fi cp $inFile ${inFile}.pli pli.exe ${inFile}.pli /(include /(ext/(/' /',Inc,Cpy/)/), flag/(i/) ;; /?) exit 1 ;; esac done fi rm -rf $inFile.pli rm -rf $inFile.OBJ rm -rf $inFile.LST # vim: set ts=4 sw=4:
pli.exe receive filename as parm and then search for filename.pli to compile, we almost use file without extention file name.
So copy filename to filename.pli then compile it.
/(include /(ext/(/' /',Inc,Cpy/)/) is compile time option pass to pli.exe, this configure copybook file's extention name, and search in sequence: blank, inc and cpy.
.
3. Add one system virable INCLUDE which value is the folder contains copybook. pli.exe search IBM.SYSLIB and then INCLUDE to find copybook.
.
4. Compile: I use the source from multics: www.multicians .org
Use vim open it and edit, then use :make % command, % means current filename.
Vim will call rdzpli.exe in this format: rdzpli.exe <current_filename>, the compilation result will be open in quickfix window automaticlly after compile complete.
Quickfix:
Maybe it's not the best way to compile pli, but it can integrate with vim to locate error position in quickfix then use vim's advantage. Perhaps we can integrate vim with RDZ based on ecplise in the future.