HH&S product

EVMPR VM/CMS REXX emulator for UNIX/Windows

VM/CMS-style runtime for REXX on UNIX, Linux and Windows.

VM/CMS emulator for REXX - Version 2.21

SUMMARY

  1. WHAT IS EVMPR
  2. RECOMMENDED HARDWARE
  3. SOFTWARE REQUIREMENTS
  4. VM/CMS  SUPPORTED COMMANDS
  5. BINARY FILE PROCESSING USING PIPES
  6. INTEGRATING VM/CMS PROCEDURES IN EVMPR
  7. 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)

Summary

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

Summary

 

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

Summary

 

4 - VM/CMS supported commands 

General Commands

 

GLOBALV command

  • 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"

Summary

 

EXEC command

  • 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

Summary

 

I/O

 

Abstact :

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 $, &, ...)

The wildcard notation (*) is supported except in the filemode.

Summary

 

ERASE command

  • syntax : "ERASE fn ft fm"
  • limitations : Operating System's limitations
  • examples :
    "ERASE AB* *CD* /path/data " (Unix)
    "ERASE AB* *CD* U:\path\data" (Windows)

Summary

  

RENAME command

  • 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)

 

Summary

 

COPY command

  • 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)

Summary

 

STATE command

  • 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 */

 

Summary

 

LISTFILE command

  • 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)

Summary

 

EXECIO command

  • 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

Summary

 

Pipes and Pipe stages (filters)

Abstact :

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"

 

Summary

 

ADDSTREAM command

  • syntax : "ADDSTREAM OUTPUT alias"
  • limitations : the INPUT direction is not implemented on this version.
  • example : check the SELECT command below

Summary

 

ADDPIPE command

  • syntax : "ADDPIPE *.OUTPUT.alias: | > fn ft fm"
  • limitations :
- the INPUT direction is not implemented on this version.
- file ('fn ft fm') is associated to alias and open for output

Summary

 

ENDPIPE command

  • syntax : "ENDPIPE alias"
  • limitations : immediate and definitive close of file associated to alias

Summary

 

SELECT command

  • 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"

 

Summary

 

OUTPUT command

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)

Summary

 

READTO command

in this version, reading is through standard input, by text ligne

Binary possibily (check the 'Binary Processing' topic below)

do forever

"READTO ligne"

if rc <> 0 then leave /* End Of File on stdin */

...

end

Summary

 

DROP stage

Summary

 

TAKE stage

Summary

 

CHANGE stage

Summary

 

LITERAL stage

Summary

 

FANIN stage

Summary

 

Recognized but ignored commands :

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

Summary

 

SET SYSIN and SET SYSOUT commands

"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

 

Summary

 

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)

 

File Systems adaptation

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

 

Pipes adaptation

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'

System calls adaptation

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)

Script wrapper

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

Summary

 

 

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 :


For more information, contact us.