$! To add a command to DCLTABLES, do the following:
$!   $ @ADDCOMMAND devdir:newcommand.CLD
$! Where "devdir" is the device and directory containing the CLD file,
$! and "newcommand" is the file name of the file.
$!
$ IF P1 .EQS. "" THEN INQUIRE P1 "Location of MODIFY.CLD file"
$ LENP1 = F$LENGTH(P1)
$ IF LENP1 .EQ. 0 THEN GOTO STEP1
$ len0 = f$locate("[",P1)
$ IF LENP1 .NE. LEN0 THEN GOTO STEP1
$ P1 = P1 - ":" + ":" + "MODIFY.CLD"
$GOTO STEP2
$STEP1:
$ P1 = P1 + "MODIFY.CLD"
$STEP2:
$ FMOD = F$SEARCH(P1)
$STEP3:
$ p1=f$search(p1)	! Find actual cld file
$ WRITE SYS$OUTPUT "CLD file is ''p1'"
$ file=f$search("sys$library:dcltables.exe")	! Find current DCL tables
$ write sys$output "Original DCL tables file is ''file'"
$ len1 = f$locate(";",file)
$ file2 = f$extract(0,len1,file)
$ file2 = file2 + ";0"		! Define new DCL tables
$ SET COMMAND/TABLE='file' -		! Create new table
             /OUTPUT='file2' 'P1'
$ file2=f$search("''file2'")	! Find current DCL tables
$ write sys$output "New DCL tables file is ''file2'"
$ len1 = f$locate(";",file2)
$ file2 = f$extract(0,len1,file2)
$ open/write cmd replace.com
$ write cmd "$ RUN SYS$SYSTEM:INSTALL"
$ write cmd "''file2'/REPLACE"
$ close cmd
$@replace.com
$ write sys$output "If you are on a cluster, execute REPLACE.COM"
$ write sys$output "on other nodes with the same system disk."
$ write sys$output "execute ADDMODIFY.COM"
$ write sys$output "on other nodes with a different system disk."
$ write sys$output "You will have to log in again to get new tables."
$END:
$EXIT
