Python for OpenVMS *March 28, 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 * http protocol http://www.pi-net.dyndns.org/anonymous/jfp/ * ftp (anonymous) protocol ftp://ftp.pi-net.dyndns.org/jfp/ You need to download the following files: * The latest source kit from http://vmspython.dyndns.org/anonymous/jfp/python-2_3-vms-src.zip * Libraries used by this distribution of Python like zlib, libjpeg, libgd, libgdchart, libpng, libimaging, etc... o Prebuild version http://vmspython.dyndns.org/anonymous/jfp/toolslib.zip o Source version http://vmspython.dyndns.org/anonymous/jfp/toolslibsrc.zip * A complete building procedure http://vmspython.dyndns.org/anonymous/jfp/python_install-2_3.txt . Thank's to Colin Brown. You will have to rename this procedure as python_install-2_3.com Warning: o Some browser rename zip file into .gz, so after download rename them back to .zip o If the file attributes were not restored correctly, then backup command will report CRC error. Your version of unzip is probably to old. You can set the correct attributes with the command: $ set file/attrib=(rfm:fix,rat:none,lrl:32256) 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: * PYTHONHOME * PYTHONPATH * PYTHON_EXEC_PREFIX_V * PYTHON_ROOT * PYTHON_INCLUDE * PYTHON_VMS * PYTHON_TOOLS * PYTHON_OLB * PYTHON_EXEC_PREFIX_V * PYTHONCASE if Python is installed on an ODS-2 volume 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: * PYTHON_CFG_FLOAT * PYTHON_CFG_THREADS * PYTHON_TMP_P * PYTHON_TMP_V * TMPDIR ------------------------------------------------------------------------ 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: * il_arrayUnsignedLong * il_arrayUnsignedShort * il_count1String * il_noType * il_signedByte * il_signedLong * il_signedLongByValue * il_signedLongLong * il_signedWord * il_string * il_unsignedByte * il_unsignedLong * il_unsignedLongLong * il_unsignedWord 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*: * delete_logical * delete_symbol * do_command * find_image_symbol * free_ef * get_command * get_common * get_ef * get_logical * getdvi * getjpi * getqui * getsyi * put_common * put_output * reserve_ef * run_program * set_logical * set_symbol * spawn 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 * add_holder * add_ident * add_proxy * adjwsl * alloc * ascefc * asctim * asctoid * ascutc * assign * audit_eventw * avoid_preempt * bintim * binutc * brkthruw * cancel * check_access * check_privilegew * chkpro * clref * cpu_capabilities * create_galaxy_lock * create_galaxy_lock_table * crelnm * crelnt * crembx * creprc * cvt_filename * dacefc * dalloc * dassgn * delete_galaxy_lock * delete_galaxy_lock_table * delete_intrusion * delete_proxy * dellnm * delmbx * delprc * deq * device_path_scan * device_scan * dismount * display_proxy * dlcefc * enqw * erapat * filescan * find_held * find_holder * finish_rdb * forcex * free_user_capability * get_galaxy_lock_info * get_galaxy_lock_size * get_security * get_user_capability * getdviw * getenv * getjpiw * getlkiw * getmsg * getquiw * getrmi * getsyiw * gettim * getuai * getutc * grantid * hash_password * icc_accept * icc_close_assoc * icc_connectw * icc_disconnectw * icc_open_assoc * icc_receivew * icc_reject * icc_replyw * icc_transceivew * icc_transmitw * idtoasc * init_vol * io_cleanup * io_fastpathw * io_performw * io_setup * mod_holder * mod_ident * mount * numtim * numutc * parse_acl * persona_assume * persona_clone * persona_create * persona_delegate * persona_delete * persona_delete_extension * persona_extension_lookup * persona_find * persona_modify * persona_query * persona_reserve * process_affinity * process_capabilities * process_scan * purgws * readef * registryw * release_galaxy_lock * rem_holder * rem_ident * resched * resume * revokid * scan_intrusion * schdwk * set_devicew * set_implicit_affinity * set_process_propertiesw * set_resource_domain * set_security * setddir * setdfprot * setef * setime * setpri * setprn * setprv * setshlv * setswm * setuai * setup_avoid_preempt * snderr * sndjbcw * subsystem * suspnd * time_to_utc * trnlnm * utc_to_time * verify_proxy * waitfr * wake * wfland * wflor ------------------------------------------------------------------------ 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