Distributed Name Service (DNS) Management Programming Manual

DNS Programming Example, COBOL85
46958 Tandem Computers Incorporated E–23
PERFORM 100-INITIALIZE.
*
* Perform lookup loop until we're done or we get an error
*
PERFORM
200-LOOKUP-LOOP
UNTIL DONE OR NOT DNS-NO-ERROR.
*
* Return NOTFOUND error if we didn't find a match
*
IF DNS-NO-ERROR AND DONT-HAVE-RESPONSE
SET DNS-ET-DNS TO TRUE
MOVE ZDNS-ERR-NOTFOUND TO DNS-ERROR-NUMBER.
EXIT PROGRAM.
100-INITIALIZE.
*
* Clear result and ambiguous name flag
*
SET DNS-NO-ERROR TO TRUE.
SET UNAMBIGUOUS TO TRUE.
*
* Initialize internal flags
*
SET DONT-HAVE-RESPONSE TO TRUE.
SET NOT-DONE TO TRUE.
SET DONT-MOVE-CONTEXT TO TRUE.
*
* Initialize INFO NAME parameter
*
ENTER TAL "SSNULL"
USING ZDNS-MAP-INFO-NAME-P
PARAM
GIVING SPI-STATUS.
IF SPI-STATUS = 0
*
* Build INFO NAME parameter
*
PERFORM 110-BUILD-INFO-PARAM
ELSE
PERFORM 900-SET-STATUS-ERROR.
IF DNS-NO-ERROR