INTRODUCING VM For REXX Emulator - V2.21
EVMPR runs for production 24H/24 7J/7 since january 2000 at one of our clients.
Thanks to EVMPR, client has got rid of its VM/CMS.
Batch processing is faster with EVMPR Pentium II 400Mhz - windows NT4) than it was on VM/CMS (a "VM under VM" in Facily Management ...):
They last 3 hours when they used to last more than 10 hours on VM !
Client is saving EUR 61.000 per month (monthly cost of its VM)
SUMMARY
- WHAT IS EVMPR
- RECOMMANDED HARDWARE
- PRE-REQUIRED SOFTWARE
- VM/CMS SUPPORTED COMMANDS
GLOBALV command
EXEC command
Abstact ERASE command
RENAME command
COPY command
STATE command
LISTFILE command
EXECIO command
Pipes and Pipe stages (filters)
Abstact ADDSTREAM command
ADDPIPE command
ENDPIPE command
SELECT command OUTPUT command READTO command DROP stage TAKE stage CHANGE stage LITERAL stage FANIN stage - BINARY FILE PROCESSING USING PIPES
- INTEGRATING VM/CMS PROCEDURES IN EVMPR
Integrating EVMPR engine in your procedures
General REXX programs adaptation
File System adaptation
Pipes adaptation
System Calls adaptation
Script wrapper - INCIDENTS
1 - What is EVMPR
EVMPR is a VM/CMS REXX emulation runtime for Unix/Windows running "as is" your original CMS REXX programs on inexpensive Unix/Windows and shooting your monthly IBM host fees.
It is composed of :
- a command runtime implemented by a shared library
- a command set simulating some specific VM/CMS features, implemented by programs and scripts.
- For NT platform, gzip and gunzip programs (ported and distributed by HHNS under GPL Zlib license)
2 - Recommanded Hardware
Windows and Linux platform
- CPU Pentium III 400 Mhz minimum
- necessary storage capacity
IBM AIX platform
- CPU 53P minimum
- necessary storage capacity
3 - Pre-required Software
Windows/NT platform :
- Windows/NT4 Server US, Service Pack 4 or 5
- Ressource Kit NT4
- Object Rexx IBM for Windows V1.03
- FTP and RSH services for batch automation
AIX platform
- AIX V4.3 minimum
- Object Rexx IBM for AIX V6
LINUX platform
- LINUX kernel 2.4 and above
- Run time libc5
- Object Rexx IBM for LINUX
Other UNIX platform
- We can port to any POSIX UNIX
4 - VM/CMS supported commands
- syntax :
"GLOBALV SELECT env SETP variable value" "GLOBALV SELECT env GET variable" - limitations : in this version, environment
is not saved, nor processed.
It is only simulated during the procedure. - example :
"GLOBALV SELECT MYAPPL SETP RETRC" retrc "GLOBALV SELECT MYAPPL GET RETRC"
- syntax : "EXEC command arguments"
- implementation :
Searches 'PATH' system variable for : - command.EXEC - command.REXX then transmits the command to system - limitations : Operating System's limitations
VM/CMS filesystem is simulated :
'fn ft fm' notation is accepted as is by supported commands, Windows/Unix traditionnal 'path' standing as 'filemode' (default : ./ or .\).
examples : 'name extens /path/data'( VM) = '/path/data/name.extens' (Unix)
'name extens' (VM) = './name.extens' (Unix)
Limitations are operating system's limitations (metasymbols % or $, &, ...)
La designation generique ('*') est acceptee, sauf pour le filemode.
- syntax : "ERASE fn ft fm"
- limitations : Operating System's limitations
- examples :
"ERASE AB* *CD* /path/data " (Unix)
"ERASE AB* *CD* U:\path\data" (Windows)
- syntax : "RENAME fn1 ft1 fm fn2 ft2 fm"
- abbrev. : "REN"
- limitations : Operating System's limitations
- examples :
"REN ABC DEF /path/data UVW = =" (Unix)
"REN ABC DEF /path/data = -DEF =" (Unix)
"REN ABC DEF U:\path\data XYZ = =" (Windows)
"REN ABC DEF U:\path\data = DEF2 =" (Windows)
- syntax : "COPY fn1 ft1 fm1 fn2 ft2 fm2"
- limitations : Operating System's limitations
- examples :
"COPY ABC DEF /path/data UVW = =" (Unix)
"COPY ABC DEF /path/data = = /tmp" (Unix)
"COPY ABC DEF U:\path\data XYZ = = " (Windows)
"COPY ABC DEF U:\path\data = = V:\tmp" (Windows)
- syntax : "STATE fn ft fm"
- limitations : no generic metacharacter ('*', '?', '=') in filemode
- examples :
"STATE ABC DEF /path/data" (Unix)
"STATE *ABC* * /path/data" (Unix)
"STATE ABC DEF U:\path\data" (Windows)
"STATE *ABC* * U:\path\data" (Windows)
if rc = 28 then ... /* does not exist */
- syntax : "LISTFILE fn ft fm [( ALL/DATE/LABEL STACK/LIFO ]"
- abbrev. : "LISTF"
- limitations : Operating System's limitations
- examples :
"LISTF ABC DEF /path/data ( ALL STACK" (Unix)
"LISTF ABC DEF U:\path\data (DATE LIFO" (Windows)
- DISKR function syntax :
"EXECIO n|* DISKR fn ft fm" "EXECIO n|* DISKR fn ft fm [( LIFO ]" "EXECIO n|* DISKR fn ft fm ( STEM stname]" "EXECIO 1 DISKR fn ft fm ( VAR varname]" - DISKW function syntax :
"EXECIO n|* DISKW fn ft fm" "EXECIO n|* DISKW fn ft fm ( STEM stname]" "EXECIO 1 DISKW fn ft fm ( VAR varname]" "EXECIO 1 DISKW fn ft fm ( CONST xxxxxx" - CP function syntax :
"EXECIO n|* CP ( [STACK | LIFO | FIFO ] CONST xxxxxx ..." - limitations :
on current version, data files are ascii text, binary is not processed CP command simulation is made by submiting the command 'as is' to the system, then redirecting results (standard output) into stack - examples :
EXECIO 5 DISKR fn1 ft1 fm1 ( STEM S1." EXECIO 1 DISKR fn1 ft1 fm1 ( VAR VVV" EXECIO * DISKR fn1 ft1 fm1 EXECIO * DISKW fn2 ft2 fm2 EXECIO * DISKW fn2 ft2 fm2 ( STEM S1. EXECIO 1 DISKW fn2 ft2 fm2 ( VAR vvv EXECIO 1 DISKW fn3 ft3 fm3 ( CONST this is a litteral EXECIO * CP ( CONST dir /o EXECIO * CP ( LIFO CONST grep aaa /tmp/ffff.eeeee EXECIO * CP ( CONST df -v
Pipes and Pipe stages (filters)
VM/CMS Pipe is implemented by EVMPR with Unix and Windows equivalents :
Each pipe stage is a filter that reads on standard input (stdin) and writes to standard output (stdout).
This makes it possible to replace a VM/CMS missing stage by its Unix/Windows equivalent, generaly present inside the system or easy to make.
When these stages are REXX procedure REXX, they are called by :
"rexx stage.REXX [arguments ...".
PIPE command
- syntax:
"PIPE < fn1 ft1 fm1 | stage1 | stage2 ... | > fn2 ft2 fm2" "PIPE | STEM XXX. | ...." "PIPE | VAR VVV | ...." "PIPE < fn1 ft1 fm1 | stage1 | stage2 ... | STEM XXX." "PIPE < fn1 ft1 fm1 | stage1 | stage2 ... | VAR VVV"
- limitations : only above specified syntaxes are accepted.
- check EVMPR supported Stage list below.
- examples :
"PIPE < ABCDE DATA | take 1 | VAR abcde_data"
"PIPE <" fn ft fm "| drop 1 | STEM abc."
"PIPE < ABC DATA | rexx prog1.rex ( opt1 | > ABC LOGFILE"
- syntax : "ADDSTREAM OUTPUT alias"
- limitations : the INPUT direction is not implemented on this version.
- example : check the SELECT command below
- syntax : "ADDPIPE *.OUTPUT.alias: | > fn ft fm"
- limitations :
- file ('fn ft fm') is associated to alias and open for output
- example : check the SELECT command below
- syntax : "ENDPIPE alias"
- limitations : immediate and definitive close of file associated to alias
- syntax : "SELECT OUTPUT alias"
- limitations : the INPUT direction is not implemented on this version.
- the file associated to 'alias' becomes the current output file
- example :
"ADDSTREAM OUTPUT myout1"
"ADDPIPE *.OUTPUT.myout1 : | > F123456 RESULT ."
"SELECT OUTPUT myout1"
"OUTPUT 1rst line of file F123456.RESULT"
...
"ENDPIPE myout1"
- syntax : "OUTPUT" expression
- limitations :
without 'SELECT' issued beofre, default output will be on standard output
a 'newline' is added to the expression
Binary possibily (check the 'Binary Processing' topic below)
- example : check the SELECT command above
- syntax : "READTO variable"
- limitations :
in this version, reading is through standard input, by text ligne
Binary possibily (check the 'Binary Processing' topic below)
- example :
do forever
"READTO ligne"
if rc <> 0 then leave /* End Of File on stdin */
...
end
- syntax : "PIPE < ... | DROP n | ..."
- limitations : this stage has a meaning only for text standard input
- example : check 'Pipe example' below
- syntax : "PIPE < ... | TAKE n | ..."
- limitations : this stage has a meaning only for text standard input
- example : check 'Pipe example' below
- syntax 1 : "PIPE < ... | CHANGE -x hh-hh | ..."
- limitations : 'hh-hh' notation means 2 characters hexadecimal
- syntax 2 : "PIPE < ... | CHANGE [(col1-col2) /scr1/tgt1/ [/src2/tgt2/ ...]"
- limitations : /src/tgt/ notation only accepts ASCII strings
- examples :
"PIPE <" filein "| change -x 00-20 | >" fileout /* Zero Bin. to spaces */ "PIPE <" filein "| change /ALBERT/ANATOLE/ | >" fileout "PIPE <" filein "| change (28-30) /A1/B4/ /A2/B5/ | >" fileout
- syntax :
'PIPE < ... | LITERAL "'expression'" | ...' 'PIPE | LITERAL -n "'expression'" | ...' - limitations :
the -n flag indicates there is no input to the pipe RESPECT OF SINGLE QUOTES AND DOUBLE QUOTES IS IMPORTANT - examples :
'PIPE <' filein '| literal "My Result Header" | >' fileout 'PIPE | literal -n "My Result Header" | >' fileout 'PIPE | literal -n "'right('Etat n.' n, 72)'" | >' fileout
- This stage simulated 'the best it can' VM/CMS multiples pipes merging It merges one or many file(s) with standard input
- syntax :
'PIPE < ... | FANIN fn1 ft1 fm1 fn2 ft2 fm2 ... | ...' 'PIPE < ... | FANIN -r fn1 ft1 fm1 fn2 ft2 fm2 ... | ...' - limitations : the -r flags indicates the file(s) given as parameters are written to output BEFORE the standard input stream.
- examples :
'PIPE <' filein '| fanin' wfile '| >' fileout /* first filein, then wfile */ 'PIPE <' filein '| fanin -r wfile '| >' fileout /* first wfile, then filein */
Recognized but ignored commands :
- SET (except SET SYSIN/SYSOUT)
- MAKEBUF
- DESBUF
- DROPBUF
5 - Binary File processing using Pipes
Processing a stage input/output as binary is possible (no newline)
In order to do this, we assume data type is 'VARIABLE UNBLOCKED' (RECFM V), conforming to IBM Standard format.
EVMPR supplied 'SET SYSIN' et 'SET SYSOUT' pseudo-commands, handle this data type
SET SYSIN and SET SYSOUT commands
- syntax : 'SET SYSIN/SYSOUT RECFM=ff' [LRECL=nnn si F or FB]
- limitations : following RECFM are accepted by this version :
- RECFM=V for variable unblocked "EBCDIC"
- RECFM=VB for variable blocked "EBCDIC"
- RECFM=F for fixe unblocked "EBCDIC"
- RECFM=FB for fixe blocked "EBCDIC" (= F)
- RECFM=T for "ASCII" files (defaut)"
- example :
"SET SYSIN RECFM=V"
do forever
"READTO Z" /* read as variable unblocked, without newline */
if rc <> = 0 then leave
"OUTPUT Z" /* write as text mode, including newline */
end
6 - Integrating VM/CMS procedures in EVMPR
Integrating EVMPR engine in your procedures
The following 2-commands header has to be in each REXX ou EXEC procedure running with the EVMPR runtime :
"rxsubcom register CMS orxcms orxcms"
address CMS
General REXX programs adaptation
1) change operator "^=" to "<>" ('not egal')
2) changer 'say ...' instructions of REXX stages to "EXEC NENU ..." (otherwise, they will be mixed to output stream)
3) get rid of 'trace ?i' in REXX stages (otherwise, they will be mixed to output stream)
4) eliminate/change '$' (dollar) symbol in file name (Unix)
5) eliminate/change '%' (percent) symbol in file name (Windows)
6) Change 'FileMode' values to a valid path name in VM/CMS file names
7) check the Pipe stages, replace them by a platform (Unix/Windows) equivalent
8) check multiples pipes (x:fanin), divide them into 2 distinct pipes, one producing a workfile, the other integrating the workfile via 'fanin'
9) do not forget to replace REXX stages by 'rexx stage_name.REXX'
10) prefixe system commands with 'ADDRESS CMD' (Windows) or 'ADDRESS bash' (LINUX) or 'ADDRESS ksh' (AIX)
11) take care to 'escape' magical characters and metasymbols in commands (UNIX)
12) Shell scripts (.cmd ou .sh) wrapping allow to easily start an application main procedure (generaly a .EXEC)
they set up some environment variables (
fn ft fm ) and call the main procedure via a
rexx Procedure_name.EXEC arguments
7 - Frequent Incidents
1) Syntax : operator '^=' to remplace with <>
2) files not processed : filename/filetype > 8 car., filemode = 'A' ou 'B' ...
4) System commands syntax :
- check transformation of 'fn ft fm' to 'fm/fn.ft' are correct
- 'escape' Unix metasymbols UNIX with backslash : $,[],*,?,() ...
Contact us for more details