(PYVMS LOGO) Python on OpenVMS

(go to: table of contents, index, list of vms_sys, prev: CLREF, next: CRELNT)


CRELNM - Create Logical Name


Creates a logical name and specifies its equivalence names.

vms_sys.crelnm() does _not_ raise an exception when the SYS$CRELNM routine returns an error. You must check 'status' in the dictionary that is returned.

Format:

    dict = vms_sys.crelnm ([attr] ,tabnam ,lognam \
                          ,[acmode] ,[itmlst])
Returns:
dict
A dictionary that has the following keys:
'status'
The condition value returned from SYS$CRELNM.
'LNM$_name'
Any output items that have been specified in the item-list and that are supported by SYS$CRELNM.

It is only put into the dictionary, when SYS$CRELNM returns a success status.

Arguments:
attr
Attributes to be associated with the logical name. See the system services reference manual for details. Bitmask values (LNM_M_name) are available in module 'vms_lnmdef'.
tabnam
Name of the table in which to create the logical name.
lognam
Name of the logical name to be created.
acmode
Access mode to be associated with the logical name. Normally, the access mode is 'maximized'. Because the interface runs in USER mode the logical name would normally get this mode.

If the process has SYSNAM privilege, any access mode can be specified!

itmlst
Item list describing the equivalence names for this logical name. You can also specify 'LNM$_TABLE' as an output item.
Examples:
$ set PROCESS /PRIVILEGE= SYSNAM

>>> import vms_sys
>>> import vms_lnmdef

>>> PSL_C_SUPER = 2
>>>
>>> dict = vms_sys.crelnm (vms_lnmdef.LNM_M_CONFINE, \
...        'LNM$JOB', 'LNM1', PSL_C_SUPER, \
...        ( ('LNM$_STRING', 'VALUE'), \
...          ('LNM$_TABLE',  None   )
...        )
...        )
>>>
>>> for k in dict.keys():
...   print k, dict.get(k)
...
LNM$_TABLE LNM$JOB_814E29C0
status 1
>>>
>>> import os
>>> os.system ('show logical /job /full LNM1*')

(LNM$JOB_814E29C0)  [kernel]  [shareable]  [Quota=(928,2048)]
                    [Protection=(RWCD,RWCD,,)]  [Owner=[HOME,ZESSIN]]

  "LNM1" [super] = "VALUE"
1        <-- return status from os.system()
>>>


>>> dict = vms_sys.crelnm (vms_lnmdef.LNM_M_CONFINE, \
...        'LNM$GROUP', 'LNM1', PSL_C_SUPER, \
...        ( ('LNM$_ATTRIBUTES', vms_lnmdef.LNM_M_CONCEALED), \
...          ('LNM$_STRING', 'VALUE1'), \
...          ('LNM$_ATTRIBUTES', 0), \
...          ('LNM$_STRING', 'VALUE2'), \
...          ('LNM$_TABLE',  None   )
...        )
...        )
>>>
>>> for k in dict.keys():
...   print k, dict.get(k)
...
LNM$_TABLE LNM$GROUP_010040
status 1
>>>
>>> import os
>>> os.system ('show logical /group /full LNM1*')

(LNM$GROUP_010040)  [kernel]  [shareable,group]
                    [Protection=(RWCD,R,R,)]  [Owner=[HOME,*]]

  "LNM1" [super] = "VALUE1" [concealed]
        = "VALUE2"
1        <-- return status from os.system()
>>>


>>> dict = vms_sys.crelnm (None, \
...        'LNM$PROCESS', 'LNM1', PSL_C_SUPER, \
...        ( ('LNM$_STRING', 'VALUE'), \
...          ('LNM$_TABLE',  None   )
...        )
...        )
>>>
>>> for k in dict.keys():
...   print k, dict.get(k)
...
LNM$_TABLE LNM$PROCESS_TABLE
status 1
>>>
>>> dict = vms_sys.crelnm (None, \
...        'LNM$PROCESS', 'LNM1', PSL_C_SUPER, \
...        ( ('LNM$_STRING', 'VALUE'), \
...          ('LNM$_TABLE',  None   )
...        )
...        )
>>>
>>> status = dict.get('status')
>>> status
1585
>>> vms_sys.getmsg (status)
('%SYSTEM-S-SUPERSEDE, logical name superseded', (0, 0, 0, 0))
>>>

------------------------------

>>> dict = vms_sys.crelnm (None, \
...        'LNM$PROCESS', 'LNM1', PSL_C_SUPER, \
...        ( ('LNM$_STRING', 'VALUE'), \
...          ('LNM$_ACMODE',3),
...          ('LNM$_TABLE',  None   )
...        )
...        )
>>>
>>> for k in dict.keys():
...   print k, dict.get(k)
...
status 20
>>>
>>> status = dict.get('status')
>>> vms_sys.getmsg (status)
('%SYSTEM-F-BADPARAM, bad parameter value', (0, 0, 0, 0))
>>>

@@ more examples for CRELNM

(go to: table of contents, index, list of vms_sys, prev: CLREF, next: CRELNT)

29-NOV-1998 ZE.