Python for OpenVMS

Python for OpenVMS


January 3, 2003


Copyright, 2002 Jean-François Piéronne

Contents Index


Chapter 1
Installation

This chapter describe installation of Python 2.3 on OpenVMS.

Software Version: 2.3

Python 2.3 has a new interface to SYS$ and LIB$ routines, the older one is still present but will not be maintained.

There is also a new API to access RMS indexed files.

The Rdb interface has been enhanced.

1.1 Requirement

1.1.1 OpenVMS

Python 2.3 require VMS 7.3 or newer, and TCPIP 5.3 or newer.

For VMS 7.3, you will have to install patch VMS73_ACRTL-V0200 or higher.

DECC 6.5 is also required.

Some tests have been done using VMS 7.2 and TCPIP 7.1.

It is strongly suggested to install Python 2.3 on an ODS-5 volume, however some successfull tests on an ODS-2 volume have been done if the logical PYTHONCASEOK is defined.

1.1.2 OPENSSL

Python 2.3 use OPENSSL, so you have to download and install OPENSSL from http://www.openssl.org/

1.1.3 Various tools

As the packages are in zip format you need UNZIP.

You will need GUNZIP and VMSTAR to install OPENSSL.

1.2 Download files

File can be download from You need to download the following files:

1.3 Installation

1.3.1 OpenSSL

Installation of OpenSSL is beyond the scope of this manual, read http://www.openssl.org/

1.3.2 Build Python

Run the procedure python_install-2_3.com, for example


$ @python_install-2_3 disk$tools:[lib] disk$tools:[python-2_3]
Install the libraries into the directory disk$tools:[lib] and Python into disk$tools:[python-2_3].

1.3.3 setup Python

1.3.3.1 logicals.com procedure

The procedure logicals.com defined most of the logicals needed to run Python.

You can, for example add this procedure to your SYSTARTUP_VMS.COM. For example if Python is installed into disk$tools:[Python-2_3]


$ @disk$tools:[Python-2_3.vms]logicals "/system"

If you have installed Python 2.3 on an ODS-2 volume activate the definition of PYTHONCASEOK into the procedure logicals.com.

Logicals names defined by this procedure:

1.3.3.2 setup.com procedure

To run python you have to execute for each session the procedure setup.com


$ @python_vms:setup
This procedure defined the symbol PYTHON and the logicals names:


Chapter 2
OpenVMS RTL

Python 2.3 for OpenVMS has new interfaces to LIB$, SYS$ routines, RMS indexed files and some CRTL routines.

All functions generate an exception when an error is encountered.

Python do not allow character '$' into indentifier name, so all '$' character has been replaced by an underscore '_' character.

2.1 Items List

When a function required an items list as a parameter, it is named itmlst except when more than one item list is used (for example creprc) and in very few routine (for example filescan). The module vms.itemList contains the class itemList which is used to build an item list (sequence of objects itemList).

itemList


Syntax

itm = itemList ([code] [,value] [,dtype] [,length] [,flags])


ARGUMENTS

code

item code, type is integer

value

item value, type is integer or string

dtype

type of item, values are:

length

item length, you only need to specified this argument for type array or string.
Default length of string is 1024

flags

rfu

2.2 LIB$ routines

The following routines are available from the module vms.rtl.lib:

All functions has a documentation string, for example:


$ python
Python 2.3a0 (#0, Wed Nov 20 15:33:23 2002) [DECC] on OpenVMS Alpha (G_float)
Type "help", "copyright", "credits" or "license" for more information.
>>> import vms.rtl.lib
>>> vms.rtl.lib.delete_logical.__doc__
'status = delete_logical(logical_name [,table_name])'
>>> 

All parameters name can be used as keyword.


$ python
Python 2.3a0 (#0, Wed Nov 20 15:33:23 2002) [DECC] on OpenVMS Alpha (G_float)
Type "help", "copyright", "credits" or "license" for more information.
>>> from vms.psldef import PSL_C_EXEC
>>> from vms.rtl.lib import get_logical
>>> get_logical.__doc__
'status, resultant_string max_index = get_logical(logical_name [,table_name] [,index] [,accmod] [,flags])'
>>> get_logical('SYS$STARTUP', index=1, accmod=PSL_C_EXEC)
(1, 'SYS$MANAGER', 1)
>>> 


delete_logical


Syntax

status = delete_logical (logical_name [,table_name])


ARGUMENTS

logical_name

type: string

table_name

type: string

delete_symbol


Syntax

status = delete_symbol (symbol_name [,table_type_indicator])


ARGUMENTS

symbol_name

type: string

table_type_indicator

type: integer

do_command


Syntax

status = do_command (command)


ARGUMENTS

command

type: string

find_image_symbol


Syntax

status, symbol _value = find_image_symbol (filename, symbol [,image_name] [,flags])


ARGUMENTS

filename

type: string

symbol

type: string

image_name

type: string

flags

type: integer

free_ef


Syntax

status = free_ef (event_flag_number)


ARGUMENTS

event_flag_number

type: integer

get_command


Syntax

status, resultant _string = get_command ([prompt_string])


ARGUMENTS

prompt_string

type: string

get_common


Syntax

status, resultant _string = get_common ( )


ARGUMENTS

None


get_ef


Syntax

status, event _flag_number = get_ef ( )


ARGUMENTS

None


get_logical


Syntax

status, resultant _string max_index = get_logical (logical_name [,table_name] [,index] [,accmod] [,flags])


ARGUMENTS

logical_name

type: string

table_name

type: string

index

type: integer

accmod

type: integer, use module vms.psldef

flags

type: integer

getdvi


Syntax

status, integer _value, resultant_string = getdvi (item_code [, channel], [device_name])


ARGUMENTS

item_code

type: integer, use module vms.dvidef

channel

type: integer

device_name

type: string

getjpi


Syntax

status, process _id, integer_value, resultant_value, resultant_string = getjpi (item_code [, process_id] [,process_name])


ARGUMENTS

item_code

type: integer, use module vms.jpidef

process_id

type: integer

process_name

type: string

getqui


Syntax

status, resultant _value, resultant_string = getqui (function_code [,item_code] [,search_number] [,search_name] [,search_flags])


ARGUMENTS

function_code

type: integer, use module vms.quidef

item_code

type: integer, use module vms.quidef

search_number

type: integer

search_name

type: integer

search_flags

type: integer

getsyi


Syntax

status, resultant _value, resultant_string cluster_system_id = getsyi (item_code [,cluster_system_id] [,node_name])


ARGUMENTS

item_code

type: integer, use module vms.syidef

cluster_system_id

type: integer

node_name

type: string

put_common


Syntax

status, resultant _length = put_common (source_string)


ARGUMENTS

source_string

type: string

put_output


Syntax

status = put_output (message_string)


ARGUMENTS

message_string

type: string

reserve_ef


Syntax

status = reserve_ef (event_flag_number)


ARGUMENTS

event_flag_number

type: integer

run_program


Syntax

status = run_program (program_name)


ARGUMENTS

program_name

type: integer

set_logical


Syntax

status [item_list_result] = set_logical (logical_name [,value_string] [,table] [,item_list])


ARGUMENTS

logical_name

type: string

value_string

type: string

table

type: string

itmlst

type: sequence of itemList, use module vms.lnmdef

set_symbol


Syntax

status [item_list_result] = set_symbol (symbol, value_string [,table_type])


ARGUMENTS

symbol

type: string

value_string

type: string

table_type

type: integer

spawn


Syntax

status, process _id, completion_status = spawn ([command] [,input_file] [,output_file] [,flags] [,process_name] [,event_flag] [,prompt] [,cli] [,table])


ARGUMENTS

command

type: string

input_file

type: string

output_file

type: string

flags

type: integer

process_name

type: string

event_flag

type: integer

prompt

type: string

cli

type: string

table

type: string

2.3 SYS$ routines

The following routines are available from the module vms.starlet:

acquire_galaxy_lock


Syntax

status = acquire_galaxy_lock (handle [,timeout] [,flags])


ARGUMENTS

handle

type: unsigned long integer

timeout

type: unsigned integer

flags

type: unsigned integer

add_holder


Syntax

status = add_holder (rights_id, rights_holder [,attrib])


ARGUMENTS

rights_id

type: unsigned integer

rights_holders

type: unsigned long integer

attrib

type: unsigned integer

add_ident


Syntax

status, resid = add_ident (name [,id] [,attrib])


ARGUMENTS

name

type: srting

id

type: unsigned integer

attrib

type: unsigned integer

add_proxy


Syntax

status = add_proxy (rem_node, rem_user, local_user [,flags])


ARGUMENTS

rem_node

type: string

rem_user

type: string

local_user

type: string

flags

type: unsinged integer

adjwsl


Syntax

status, wsetlm = adjwsl ([pagecnt])


ARGUMENTS

pagecnt

type: integer

alloc


Syntax

status, phybuf = alloc (devnam [,accmode] [,flags])


ARGUMENTS

devnam

type: string

accmode

type: unsigned integer, use module vms.psldef

flags

type: unsigned integer

ascefc


Syntax

status = ascefc (efn, name [,prot] [,perm])


ARGUMENTS

efn

type: unsigned integer

name

type: string

prot

type: unsigned integer

prot

type: unsigned integer

perm

type: unsigned integer

asctim


Syntax

status, timbuf = asctim (tim [,cvtflg])


ARGUMENTS

tim

type: long integer

cvtflg

type: unsigned integer

asctoid


Syntax

status, id, attrib = asctoid (name)


ARGUMENTS

name

type: string

ascutc


Syntax

status, timbuf = ascutc ([tim] [,cvtflg])


ARGUMENTS

tim

type: long integer

cvtflg

type: unsigned integer

assign


Syntax

status, channel = assign (devnam [,acmode] [,mbxnam] [,flags])


ARGUMENTS

devnam

type: string

acmode

type: unsigned integer, use module vms.psldef

mbxnam

type: string

flags

type: unsigned integer

audit_eventw


Syntax

status, audsts [,resdic] = audit_eventw ([efn] [,flags] [,itmlst])


ARGUMENTS

efn

type: unsigned integer

flags

type: unsigned integer, use module vms.nsadef

itmlst

type: sequence of itemList, use module vms.nsadef


Next Contents Index