Distributed Name Service (DNS) Management Programming Manual

DNS Programming Example, COBOL85
46958 Tandem Computers Incorporated E–3
*
* Parameter to DNS-ADD-ALIAS and DNS-ALTER-ALIAS
*
01 DOMAIN PIC X(32) VALUE "LOCAL".
*
* Parameter to DNS-ADD-ALIAS
*
01 ATYPE PIC X(16) VALUE SPACES.
*
* Parameter to DNS-ADD-ALIAS, DNS-ALTER-ALIAS, and DNS-DELETE-DNSNAME
*
01 ALIAS PIC X(32).
*
* Parameter to DNS-LOOKUP
*
COPY DNS-LOOKUP-PARAM.
*
* Parameter to DNS-ADD-ALIAS
*
01 MANAGER PIC X(32).
*
* Indicates if the user wishes to delete the alias added in the
* program
*
01 DELETE-FLAG PIC X.
88 DO-DELETE VALUES "Y" "y".
EXTENDED-STORAGE SECTION.
COPY ZSPI-DDL-TOKENCODE IN $FALL.ZSPIDEF.ZSPICOB.
COPY CONSTANTS IN $FALL.ZSPIDEF.ZSPICOB.
COPY CONSTANTS IN $FALL.ZSPIDEF.ZDNSCOB.
COPY DNS-ERROR-TEXT.
PROCEDURE DIVISION.
MAINLINE.
*
* Open the name manager
*
CALL DNS-OPEN
USING DNS-RESULT
DNS-VERSION.
IF NOT DNS-NO-ERROR
DISPLAY "Open of name manager Failed"
PERFORM DISPLAY-ERROR.
*
* Build DNS-LOOKUP-PARAM to look for SSOBJECTs and SSMANAGERs
*