hp.com home products and services support and drivers solutions how to buy
cd-rom home
End of Jump to page title
HP OpenVMS systems
documentation

Jump to content


HP OpenVMS Programming Concepts Manual

HP OpenVMS Programming Concepts Manual


Previous Contents Index

E.10 PL/I Implementations

Table E-10 lists the OpenVMS data types and their corresponding PL/I data type declarations.

Table E-10 PL/I Implementations
OpenVMS Data Types PL/I Declarations
access_bit_names 1 ACCESS_BIT_NAMES(32),
2 LENGTH FIXED BINARY(15),
2 DTYPE FIXED BINARY(7)
INITIAL((32)DSC$K_DTYPE_T),
2 CLASS FIXED BINARY(7)
INITIAL((32)DSC$K_CLASS_S),
2 CHAR_PTR POINTER; 1
  The length of the LENGTH field in each element of the array should correspond to the length of a string of characters pointed to by the CHAR_PTR field. The constants DSC$K_CLASS_S and DSC$K_DTYPE_T can be used by including the module $DSCDEF from PLI$STARLET.
access_mode FIXED BINARY(7)
(The constants for this type---PSL$C_KERNEL, PSL$C_EXEC, PSL$C_SUPER, PSL$C_USER---are declared in module $PSLDEF in PLI$STARLET.)
address POINTER
address_range (2) POINTER 1
arg_list 1 ARG_LIST BASED,
2 ARGCOUNT FIXED BINARY(31),
2 ARGUMENT (X REFER (ARGCOUNT))
POINTER; 1
  If the arguments are passed by value, you may need to change the type of the ARGUMENT field of the structure. Alternatively, you can use the POSINT, INT, or UNSPEC built-in functions and pseudovariables to access the data. X should be an expression with a value in the range 0 to 255 when the structure is allocated.
ast_procedure PROCEDURE or ENTRY 2
boolean BIT ALIGNED 1
byte_signed FIXED BINARY(7)
byte_unsigned FIXED BINARY(7) 3
channel FIXED BINARY(15)
char_string CHARACTER( n) 4
complex_number (2) FLOAT BINARY( n) (See floating_point for values of n.)
cond_value See STS$VALUE in module $STSDEF in PLI$STARLET. 1
context FIXED BINARY(31)
date_time BIT(64) ALIGNED 5,6
device_name CHARACTER( n) 4
ef_cluster_name CHARACTER( n) 4
ef_number FIXED BINARY(31)
exit_handler_block 1 EXIT_HANDLER_BLOCK BASED,
2 FORWARD_LINK POINTER,
2 HANDLER POINTER,
2 ARGCOUNT FIXED BINARY(31),
2 ARGUMENT ( n REFER (ARGCOUNT))
POINTER; 1
(Replace n with an expression that yields a value between 0 and 255 when the structure is allocated.)
fab See module $FABDEF in PLI$STARLET.
file_protection BIT(16) ALIGNED 1
floating_point FLOAT BINARY( n)
The values for n are as follows:
1 <= n <= 24 --- F_floating
25 <= n <= 53 --- D_floating
25 <= n <= 53 --- G_floating (with /G_FLOAT)
54 <= n <= 113 --- H_floating
function_code BIT(32) ALIGNED
identifier POINTER
invo_context_blk 7 %INCLUDE LIBICB
invo_handle 7 FIXED BINARY(31)
io_status_block Because the format for I/O status blocks differs with the system service, you can vary the definitions accordingly. Some of the common formats are as follows:

1 IOSB_SYS$GETSYI,
2 STATUS FIXED BINARY(31),
2 RESERVED FIXED BINARY(31);

1 IOSB_TTDRIVER_A,
2 STATUS FIXED BINARY(15),
2 BYTE_COUNT FIXED BINARY(15),
2 MBZ FIXED BINARY(31) INITIAL(0);

1 IOSB_TTDRIVER_B,
2 STATUS FIXED BINARY(15),
2 TRANSMIT_SPEED FIXED BINARY(7),
2 RECEIVE_SPEED FIXED BINARY(7),
2 CR_FILL FIXED BINARY(7),
2 LF_FILL FIXED BINARY(7),
2 PARITY_FLAGS FIXED BINARY(7),
2 MBZ FIXED BINARY(7) INITIAL(0);

item_list_2 1 ITEM_LIST_2,
2 ITEM(SIZE),
3 COMPONENT_LENGTH FIXED
BINARY(15),
3 ITEM_CODE FIXED BINARY(15),
3 COMPONENT_ADDRESS POINTER,
2 TERMINATOR FIXED BINARY(31)
INITIAL(0); 1

(Replace SIZE with the number of items you want.)
item_list_3 1 ITEM_LIST_3,
2 ITEM(SIZE),
3 BUFFER_LENGTH FIXED
BINARY(15),
3 ITEM_CODE FIXED BINARY(15),
3 BUFFER_ADDRESS POINTER,
3 RETURN_LENGTH POINTER,
2 TERMINATOR FIXED BINARY(31)
INITIAL(0); 1

(Replace SIZE with the number of items you want.)
item_list_pair 1 ITEM_LIST_PAIR,
2 ITEM(SIZE),
3 ITEM_CODE FIXED BINARY(31),
3 ITEM UNION,
4 INTEGER FIXED BINARY(31),
4 REAL FLOAT BINARY(24),
2 TERMINATOR FIXED BINARY(31)
INITIAL(0); 1

(Replace SIZE with the number of items you want.)
item_quota_list 1 ITEM_QUOTA_LIST,
2 QUOTA(SIZE),
3 NAME FIXED BINARY(7),
3 VALUE FIXED BINARY(31),
2 TERMINATOR FIXED BINARY(7)
INITIAL(PQL$_LISTEND); 1

(Replace SIZE with the number of quota entries you want to use. The constant PQL$_LISTEND can be used by including the module $PQLDEF from PLI$STARLET or by declaring it GLOBALREF FIXED BINARY(31) VALUE.)

lock_id FIXED BINARY(31)
lock_status_block 1 LOCK_STATUS_BLOCK,
2 STATUS_CODE FIXED BINARY(15),
2 RESERVED FIXED BINARY(15),
2 LOCK_ID FIXED BINARY(31); 1
lock_value_block The declaration of an item of this structure depends on the use of the structure because the OpenVMS operating system does not interpret the value. 1
logical_name CHARACTER( n) 4
longword_signed FIXED BINARY(31)
longword_unsigned FIXED BINARY(31) 3
mask_byte BIT(8) ALIGNED
mask_longword BIT(32) ALIGNED
mask_quadword BIT(64) ALIGNED
mask_word BIT(16) ALIGNED
mechanism_args INCLUDE $CHFDEF
Declare mechanism_args like CHF$MECH_ARRAY
null_arg Omit the corresponding parameter in the call. For example, FOO(A,,B) would omit the second parameter.
octaword_signed BIT(128) ALIGNED 5,6
octaword_unsigned BIT(128) ALIGNED 5,6
page_protection FIXED BINARY(31) (The constants for this type are declared in module $PRTDEF in PLI$STARLET.)
procedure PROCEDURE or ENTRY 2
process_id FIXED BINARY(31)
process_name CHARACTER( n) 4
quadword_signed BIT(64) ALIGNED 5,6
quadword_unsigned BIT(64) ALIGNED 5,6
rights_holder 1 RIGHTS_HOLDER,
2 RIGHTS_ID FIXED BINARY(31),
2 ACCESS_RIGHTS BIT(32)
ALIGNED; 1
rights_id FIXED BINARY(31)
rab See module $RABDEF in PLI$STARLET. 1
section_id BIT(64) ALIGNED
section_name CHARACTER( n) 4
system_access_id BIT(64) ALIGNED
time_name CHARACTER( n) 4
transaction_id BIT(128) ALIGNED 5,6
uic FIXED BINARY(31)
user_arg ANY
varying_arg ANY with OPTIONS(VARIABLE) on the routine declaration or with OPTIONAL on the parameter declaration.
vector_byte_signed ( n) FIXED BINARY(7) 8
vector_byte_unsigned ( n) FIXED BINARY(7) 3,8
vector_longword_signed ( n) FIXED BINARY(31) 8
vector_longword_unsigned ( n) FIXED BINARY(31) 3,8
vector_quadword_signed ( n) BIT(64) ALIGNED 5,6,8
vector_quadword_unsigned ( n) BIT(64) ALIGNED 3,5,6,8
vector_word_signed ( n) FIXED BINARY(15) 8
vector_word_unsigned ( n) FIXED BINARY(15) 3,8
word_signed FIXED BINARY(15)
word_unsigned FIXED BINARY(15) 5


1System routines are often written so the parameter passed occupies more storage than the object requires. For example, some system services have parameters that return a bit value as a longword. These variables must be declared BIT(32) ALIGNED (not BIT(n) ALIGNED) so that adjacent storage is not overwritten by return values or used incorrectly as input. (Longword parameters are always declared BIT(32) ALIGNED.)
2AST procedures and those passed as parameters of type ENTRY VALUE or ANY VALUE must be external procedures. This applies to all system routines that take procedure parameters.
3This is actually an unsigned integer. This declaration is interpreted as a signed number; use the POSINT function to determine the actual value.
4System services require CHARACTER string representation for parameters. Most other system routines allow either CHARACTER or CHARACTER VARYING. For parameter declarations, n should be an asterisk (*).
5PL/I does not support FIXED BINARY numbers with precisions greater than 31. To use larger values, declare variables to be BIT variables of the appropriate size and use the POSINT and SUBSTR bits as necessary to access the values, or declare the item as a structure. The RTL routines LIB$ADDX and LIB$SUBX may be useful if you need to perform arithmetic on these types.
6Routines declared in PLI$STARLET often use ANY, so you are free to declare the data structure in the most convenient way for the application. ANY may be necessary in some cases because PL/I does not allow parameter declarations for some data types used by OpenVMS. (In particular, PL/I parameters with arrays passed by reference cannot be declared to have nonconstant bounds.)
7Alpha and I64 specific.
8For parameter declarations, the bounds must be constant for arrays passed by reference. For arrays passed by descriptor, *s should be used for the array extent instead. (OpenVMS system routines almost always take arrays by reference.)

Note

All system services and many system constants and data structures are declared in PLI$STARLET.TLB.

While the current version of PL/I does not support unsigned fixed binary numbers or fixed binary numbers with a precision greater than 31, future versions may support these features. If PL/I is extended to support these types, declarations in PLISTARLET may change to use the new data types where appropriate.

E.11 VAX MACRO Implementations

Table E-11 lists the OpenVMS data types and their corresponding VAX MACRO data type declarations.

Table E-11 VAX MACRO Implementations
OpenVMS Data Type VAX MACRO Declarations
access_bit_names .ASCID /name_for_bit0/
.ASCID /name_for_bit1/ ...
.ASCID /name_for_bit31/
access_mode .BYTE PSL$C_ xxxx
address .ADDRESSS virtual_address
address_range .ADDRESS start_address,end_address
arg_list .LONG n_args, arg1, arg2, ...
ast_procedure .ADDRESS ast_procedure
boolean .LONG 1 or .LONG 0
byte_signed .SIGNED_BYTE byte_value
byte_unsigned .BYTE byte_value
channel .WORD channel_number
char_string .ASCID /string/
complex_number na
cond_value .LONG cond_value
context .LONG 0
date_time .QUAD date_time
device_name .ASCID /ddcu:/
ef_cluster_name .ASCID /ef_cluster_name/
ef_number .LONG ef_number
exit_handler_block .LONG 0
.ADDRESS exit_handler_routine
.LONG 1
.ADDRESS status
STATUS: .BLKL 1
fab MYFAB: $FAB
file_protection .WORD prot_value
floating_point .FLOAT, .G_FLOAT, or .H_FLOAT
function_code .LONG code_mask
identifier .ADDRESSS virtual_address
invo_context_blk 1 $LIBICBDEF
invo_handle 1 .LONG
io_status_block .QUAD 0
item_list_2 .WORD component_length
.WORD item_code
.ADDRESS component_address
item_list_3 .WORD buffer_length
.WORD item_code
.ADDRESS buffer_address
.ADDRESS return_length_address
item_list_pair .LONG item_code
.LONG data
item_quota_list .BYTE PQL$_ xxxx
.LONG value_for_quota
.BYTE pql$_listend
lock_id .LONG lock_id
lock_status_block .QUAD 0
lock_value_block .BLKB 16
logical_name .ASCID /logical_name/
longword_signed .LONG value
longword_unsigned .LONG value
mask_byte .BYTE mask_byte
mask_longword .LONG mask_longword
mask_quadword .QUAD mask_quadword
mask_word .WORD mask_word
mechanism_args MECH_ARGS: $CHFDEF
null_arg .LONG 0
octaword_signed na
octaword_unsigned .OCTA value
page_protection .LONG page_protection
procedure .ADDRESS procedure
process_id .LONG process_id
process_name .ASCID /process_name/
quadword_signed na
quadword_unsigned .QUAD value
rights_holder .LONG identifier, access_rights_bitmask
rights_id .LONG rights_id
rab MYRAB: $RAB
section_id .LONG sec$k_mat xxx, version_number
section_name .ASCID /section_name/
system_access_id .QUAD system_access_id
time_name .ASCID /dd-mmm-yyyy:hh:mm:ss.cc/
transaction_id .OCTA value
uic .LONG uic
user_arg .LONG data
varying_arg Depends on the application.
vector_byte_signed .SIGNED_BYTE val1,val2, ... val n
vector_byte_unsigned .BYTE val1,val2, ... val n
vector_longword_signed .LONG val1,val2, ... val n
vector_longword_unsigned .LONG val1,val2, ... val n
vector_quadword_signed na
vector_quadword_unsigned .QUAD val1, val2, ... val n
vector_word_signed .SIGNED_WORD val1,val2, ... val n
vector_word_unsigned .WORD val1,val2, ... val n
word_signed .SIGNED_WORD value
word_unsigned .WORD value


1Alpha and I64 specific.


Previous Next Contents Index