NET/MASTER Network Control Language (NCL) Programmer's Guide

User-Defined Maps
Standard and User-Defined Maps
106160 Tandem Computers Incorporated 11–37
WHEN 16 THEN SAY "16 "&SYSMSG
OTHERWISE
SAY Unexpected error
END /*select*/
EXIT &SYS.FILE.RC
END add_record
/* ==================== GET RECORD ==================== */
get_record: PROCEDURE SHARE &usermap,&getmdo.
/* Gets one record, mapped by a user-defined map. */
&key = "77 "
FILE GET KEY=&key MDO=&getmdo.
SELECT &SYS.FILE.RC
WHEN 0 THEN DO
SAY "0 Record retrieved"
SAY "GET KEY operand value is |"&key"|"
SAY "GET &SYS.FILE.KEY value is |"&SYS.FILE.KEY"|"
END /*do*/
WHEN 4 THEN SAY "4 Record not found or EOF"
WHEN 8 THEN SAY "8 Error "&SYS.FILE.ERROR
WHEN 16 THEN SAY "16 "&SYSMSG
OTHERWISE
SAY Unexpected error
END /*select*/
EXIT &SYS.FILE.RC
END get_record
/* ================== DISPLAY RECORD ================== */
display_record: PROCEDURE SHARE &usermap,&getmdo.
/* Displays one record, mapped by a user-defined map. */
/* Distinguishes between DDL groups and fields. */
&nspaces = &1
&piece = &2
&spaces = COPIES( " ", &nspaces )
IF &piece \== "" THEN
&piecedot = &piece"."
ASSIGN OPT=MDOFIELDS ARGS FROM MDO=&getmdo.&piece
DO &i = 1 TO &SYS.VARCNT
&y = &piecedot || &&i
ASSIGN OPT=MDOFIELDS VARS=&var FROM MDO=&getmdo.&y
IF &SYS.VARCNT = 0 THEN &type = Field
ELSE &type = Group
SAY &spaces || &type &&i "is |"&getmdo.&y"|"
CALL display_record( &nspaces + 2, &y ) SHARE &getmdo.
END /*do*/
END display_record
/* ==================== CLOSE FILE ==================== */
close_file: PROCEDURE SHARE &id
/* Close file for access by NCL, but not for access */
/* by NonStop NET/MASTER. */
FILE CLOSE ID=&id
END close_file
END zex1105n
Note You should use the SHOW UDB command to ensure that EMPFILE is not being used as a UDB identifier
at your installation. If it is, edit the NCL procedure so that it uses a different UDB identifier.