RTVNETA2 RETRIEVE NETWORK ATTRIBUTES 2 TAANETC |
The Retrieve Network Attributes 2 command is an alternative method of
accessing a Network Attribute. The command interface is not of
particular value, but the CPP can be called directly as an API which
allows a simple access to any Network Attribute from a HLL.
A typical command would be:
DCL &RTNVAR *CHAR LEN(200)
DCL &ALRSTS *CHAR LEN(10)
.
RTVNETA2 NETATT(ALRSTS) RTNVAR(&RTNVAR)
CHGVAR &ALRSTS &RTNVAR
The return variable must be declared as 200 bytes. The return
variable is completely blanked out and then the value is placed into
the variable beginning at position 1.
Decimal Network Attributes are always returned as character data in
positions 1 - 9. The length will always be 9.
To access the Network attribute MAXHOP, you would specify:
DCL &RTNVAR *CHAR LEN(200)
DCL &MAXHOP *DEC LEN(9 0)
.
RTVNETA2 NETATT(MAXHOP) RTNVAR(&RTNVAR)
CHGVAR &MAXHOP %SST(&RTNVAR 1 9)
There are optional parameters for the type of network attribute
returned (C or D), and the length of the value. For example, to
access the Server Network ID you would specify:
DCL &RTNVAR *CHAR LEN(200)
DCL &NETSERVER *CHAR LEN(85)
DCL &RTNTYP *CHAR LEN(1)
DCL &RTNLEN *DEC LEN(3 0)
.
RTVNETA2 NETATT(NETSERVER) RTNVAR(&RTNVAR) +
RTNTYP(&RTNTYP) RTNLEN(&RTNLEN)
CHGVAR &NETSERVER %SST(&RTNVAR 1 &RTNLEN)
It is not necessary to use the RTNLEN value when moving from the
&RTNVAR parameter as the &RTNVAR value will have trailing blanks for
any unused data. The RTNTYP and RTNLEN parameter may be helpful in
generalized coding solutions.
Calling the CPP directly as an API
----------------------------------
The following RPG code is in a format where it can be copied using
the SEU browse function to access a Network Attribute (SYSNAME is
used as an example)
INETADS DS 200
I 1 30 NETAC
I 1 90NETAD
C MOVEL'SYSNAME 'NETATT
C* TAA Tool RTVNETA2
C CALL 'TAANETCC' Get Net Attr
C PARM NETATT 10 Network attr
C PARM NETADS Net attr DS
C PARM NETATP 1 Net attr typ
C PARM NETALN 30 Net attr len
C* Move the returned network attribute
C MOVELNETAC SYSNAM 8 System name
** The NETAC field will hold most character Network Attributes.
** The NETAD field will hold all of the decimal Network
Attributes.
** The NETATP parameter is a return value and will contain either
C or D.
** The NETALN parameter is a return value and will contain the
length of the returned value. Decimal values are always
returned as character data with a length of 9.
Command parameters *CMD
------------------
NETATT The Network Attribute to be retrieved.
RTNVAR The return variable. A required return variable
that must be declared as *CHAR LEN(200). Values are
always left justified. Decimal Network Attributes
are always presented as character data in positions
1-9.
RTNTYP The return type of Network Attribute. An optional
return variable that must be specified as *CHAR
LEN(1). Either a 'C' (character) or 'D' (decimal)
are returned.
RTNLEN The return length. An optional return variable that
must be specified as *DEC LEN(3 0). For character
type values, this is the length of the data within
the 200 bytes. For decimal type values, the length
is always 9.
Restrictions
------------
Because the command returns variables, RTVNETA2 can only be used in a
CL program. The CPP can be called from any program.
Prerequisites
-------------
The following TAA Tools must be on your system:
SNDESCMSG Send escape message
Implementation
--------------
None, the tool is ready to use.
Objects used by the tool
------------------------
Object Type Attribute Src member Src file
------ ---- --------- ---------- ----------
RTVNETA2 *CMD TAANETC QATTCMD
TAANETCC *PGM CLP TAANETCC QATTCL
|
Added to TAA Productivity tools May 1, 1996