VAX/VMS Command Language Interface o DCL - Command language interpreter o CDU - Command definition utility ENHANCEMENTS TO DCL Command Input o Larger input buffers o Multi-national character set o Command to change prompt string $ SET PROMPT="NEW> " /CARRIAGE_CONTROL NEW> Editing Commands Lines o Terminal driver feature o SET TERMINAL/LINE_EDIT/INSERT SET TERMINAL/LINE_EDIT/OVERSTRIKE Terminal Key Action ------------ ------ CTRL/A Toggle edit mode CTRL/D,LEFT ARROW Move cursor to left CTRL/E Move cursor to end of line CTRL/F,RIGHT ARROW Move cursor to right CTRL/H,BACKSPACE,F12 Move cursor to start of line CTRL/J,LINEFEED,F13 Delete previous word CTRL/U Delete to start of line CTRL/V Quote key, overrides editing keys DELETE Delete previous character Recalling Command Lines o Terminal driver supports single command recall o 20 command/1024 character buffer Recall Command Action -------------- ------ UP ARROW, CTRL/B Recall previous command DOWN ARROW Recall "next" command RECALL 5 Recall by command number RECALL LINK Recall by leading substring RECALL/ALL Display numbered commands Recalling Command Lines - continued o Recall commands not saved in recall buffer o Consecutive duplicate commands are not saved o Continued commands automatically concatenated o 255 characters per recall o Use keys at Command prompt Continuation prompt Parameter prompt Inquire prompt Defining Keys Terminal Key Description ------------ ----------- PF1-PF4 Program function keys KP0-KP9 Keypad 0-9 PERIOD,COMMA, Special keypad keys MINUS,ENTER E1-E6 LK201 special keys F6-F20 LK201 function keys o Keypad states o SET TERMINAL/APPLICATION_KEYPAD SET TERMINAL/NONUMERIC_KEYPAD Defining Keys - continued DEFINE/KEY key-name equivalence-string Qualifier Description --------- ----------- /ECHO Display equivalence /ERASE Erase the line /TERMINATE Terminate the read operation /LOG Display informational messages /IF_STATE=(state,...) States to define key in /SET_STATE=state State to set /LOCK_STATE Lock the specified state Defining Keys - continued Examples: DEFINE/KEY PF1 "Directory" DEFINE/KEY PF2 "SHOW " /NOTERMINATE /ECHO /IF_STATE=default /SET_STATE=show_options /NOLOCK_STATE DEFINE/KEY PF2 "TIME" /TERMINATE /ECHO /IF_STATE=show_options DEFINE/KEY PF3 "DEFAULT" /TERMINATE /ECHO /IF_STATE=show_options Defining Keys - continued o SHOW KEY key-name /ALL /BRIEF /DIRECTORY /FULL /LOG /STATE=(state,...) o DELETE/KEY key-name /ALL /LOG /STATE=(state,...) o SET KEY /STATE=state /LOG Image Input Verification o Example: Version 3.0 Version 4.0 ----------- ----------- $ SET VERIFY $ SET VERIFY $ @TEST.COM $ @TEST.COM $ RUN AVERAGE $ RUN AVERAGE $ EXIT 1 2 3 $ EXIT o Only when reading from DCL's input stream Image Input Verification - continued o Changing verification state SET VERIFY=(PROCEDURE,IMAGE) or F$VERIFY(1,1) SET VERIFY=(PROCEDURE,NOIMAGE) or F$VERIFY(1,0) o Testing verification state F$VERIFY () --> procedure state F$ENVIRONMENT ("PROCEDURE_VERIFICATION") --> procedure state F$ENVIRONMENT ("IMAGE_VERIFICATION") --> image state Command Output o DCL uses SYS$PUTMSG for all messages "Previous logical name assignment replaced" \SHWO\ o Rewritten error messages %DCL-W-ABVERB, ambiguous verb %DCL-W-ABVERB, ambiguous command verb - supply more characters o /LOG qualifier ALLOCATE, CLOSE, DEFINE,... Command Output - continued o Trap DCL command output + e.g., SHOW DEFAULT, WRITE SYS$OUTPUT, verification + Redefine SYS$OUTPUT using DCL commands process logical name table supervisor mode no attributes + Output file is opened, logical name is redefined New Logical Name Features o User defined logical name tables - private, shareable o Protected logical name tables o Multiple translations per logical name o Logical name table search lists o Logical name integrity levels o Logical name attributes - no_alias, confine o Translation attributes - concealed, terminal o Expanded sizes New Logical Name Features - continued o CREATE/NAME_TABLE table-name /ATTRIBUTES=(CONFINE, NO_ALIAS, SUPERSEDE) /USER_MODE /SUPERVISOR_MODE /EXECUTIVE_MODE /QUOTA=bytes /PROTECTION=protection-code /PARENT_TABLE=table /LOG o DEFINE logical-name equiv-name[,...] ASSIGN equiv-name[,...] logical-name /TABLE=name /PROCESS /GROUP /JOB /SYSTEM /USER_MODE /SUPERVISOR_MODE /EXECUTIVE_MODE /NAME_ATTRIBUTES=(NO_ALIAS, CONFINE) /TRANSLATION_ATTRIBUTES=(CONCEALED, TERMINAL) o DEASSIGN [logical-name] /TABLE=name /PROCESS /GROUP /JOB /SYSTEM /USER_MODE /SUPERVISOR_MODE /EXECUTIVE_MODE /ALL o SHOW TRANSLATION logical-name /TABLE=name /PROCESS /GROUP /JOB /SYSTEM Non-Interactive Processing o Types of processes + Interactive - login at terminal + Batch - created by job controller + Network - created by net acp + Other - all other non-interactive o Spawned subprocess interactive if + Parent is interactive, and + Input is from a terminal Non-Interactive Processing - continued o Automatic output buffer flushing SET OUTPUT_RATE=00:01:00 o Batch job restartability SET RESTART_VALUE=checkpoint_5 $RESTART - true if restarted, false otherwise BATCH$RESTART - contains SET RESTART_VALUE value o Multi-step batch jobs - SUBMIT A,B,C /PARAM=(1,2,3) Propagate global symbols Propagate logical names Define P1-P8 locally in each step SPAWN and ATTACH o Propagate logical names and tables - /LOGICAL_NAMES o Propagate symbol definitions - /SYMBOLS o Propagate key definitions and state - /KEYPAD o Propagate or specify prompt string /PROMPT=prompt-string /CARRIAGE_CONTROL o Specify CLI - /CLI=cli-name o Specify command tables - /TABLES=command-table-spec o Request notification of subprocess completion - /NOTIFY SPAWN and ATTACH - continued o How SPAWN interprets the input stream /INPUT Command Specified Specified Action --------- --------- ------ Read commands and data from implicit input X Execute command, read data from implicit input X Read commands and data from input X X Execute command then read commands and data from input SPAWN and ATTACH - continued o Restriction on /INPUT value Cannot be both non-record-oriented device (NRO) and process-permanent file (PPF) e.g., default SYS$INPUT in a command procedure o Derivation of implicit input SYS$INPUT Process Type Implicit Input --------- ------------ -------------- NRO PPF Interactive Login input stream NRO PPF Non-interactive Null device Any other Any SYS$INPUT SPAWN and ATTACH - continued o Restrictions on /OUTPUT value Cannot be both non-record-oriented device (NRO) and process-permanent file (PPF) e.g., default SYS$OUTPUT in a batch job o Derivation of implicit output SYS$OUTPUT Implicit output ---------- --------------- NRO PPF Mailbox transmitting records to parent for it to write to its current output stream Any other SYS$OUTPUT SPAWN and ATTACH - continued o Example illustrating use of output mailbox $ DEFINE SYS$OUTPUT T.LOG ! DIRECT OUTPUT TO LOG FILE $ SPAWN ! CREATE SUBPROCESS GEORGE_1 $ SHOW TIME ! OUTPUT WRITTEN TO T.LOG $ ATTACH GEORGE ! ATTACH TO PARENT PROCESS $ DEASSIGN SYS$OUTPUT ! DIRECT OUTPUT TO TERMINAL $ ATTACH GEORGE_1 ! ATTACH TO SUBPROCESS $ SHOW TIME ! OUTPUT WRITTEN TO TERMINAL CONNECT and DISCONNECT Version 3.0: Physical Terminal <----> Process Version 4.0: Physical Terminal <---> Virtual Terminal <---> Process o First use SYSGEN for the system o Then use SET TERMINAL /PERMANENT /DISCONNECTABLE for a terminal CONNECT and DISCONNECT - continued o Connect to terminal while logging in o Example: log in work lose communications line log in to new process let LOGIN connect you to your old virtual terminal continue work in old process o DISCONNECT /[NO]CONTINUE o CONNECT /[NO]CONTINUE /[NO]LOGOUT virtual-terminal-name Miscellaneous Command Changes o READ command Specify ISAM key match algorithm - /MATCH=[GT,GE,EQ] Specify time out period - /TIME_OUT=seconds Read 2048 byte records o WRITE command Accepts list of string expressions Write 1024 byte expressions Write 2048 byte symbols - WRITE/SYMBOL o ALLOCATE/GENERIC command e.g., ALLOCATE /GENERIC RK07 o SET UIC command accepts new format UICs e.g., SET UIC [VMS,GEORGE] New Lexical Functions F$CVTIME ([time], [type], [field]) --> formatted date/time string Types: Absolute, Delta, Comparison Fields: DATETIME HOURS DATE MINUTES TIME SECONDS YEAR HUNDREDTHS MONTH WEEKDAY DAY Example: F$CVTIME("TODAY","ABSOLUTE","WEEKDAY") --> Wednesday New Lexical Functions - continued F$EDIT (string, item-list) --> edited string Items: COLLAPSE TRIM COMPRESS UNCOMMENT LOWERCASE UPCASE Example: X = "foo ""a b""" F$EDIT (X,"COLLAPSE,UPCASE") --> FOO"a b" New Lexical Functions - continued F$ELEMENT (element-number, delimiter, string) --> element from the string Example: F$ELEMENT (2,"/","BOB/STEVE/ED/JEFF") --> ED New Lexical Functions - continued F$ENVIRONMENT (item) --> DCL environment information Items: CAPTIVE ON_CONTROL_Y CONTROL ON_SEVERITY NOCONTROL OUTPUT_RATE DEFAULT PROCEDURE DEPTH PROMPT INTERACTIVE PROMPT_CONTROL KEY_STATE PROTECTION MAX_DEPTH VERIFY_IMAGE MESSAGE VERIFY_PROCEDURE Example: F$ENVIRONMENT("DEFAULT") --> WRKD$:[GEORGE] New Lexical Functions - continued F$TRNLNM (name, [table], [translation], [mode], [attribute], [item]) --> logical name information Example: F$TRNLNM ("SYS$OUTPUT",,,,,"ACCESS_MODE") --> SUPERVISOR New Lexical Functions - continued F$TYPE (symbol-name) --> string specifying the type of value associated with the symbol Returned String Meaning --------------- ------- INTEGER Value is an integer or a numeric string STRING Value is a non-numeric string null string Symbol is undefined Example: X = "29" F$TYPE(X) --> INTEGER Enhanced Lexical Functions o F$FILE (file-spec, item) - new "KNOWN" item o F$GETDVI (device, item) - many new items o F$GETJPI (pid, item) - many new items o F$GETSYI (item, [node]) - many new items, new node argument o F$MODE () and F$GETJPI (pid, "MODE") - new return value o F$PARSE (file-spec, [default], [related], [field], [parse-type]) - new parse type argument (SYNTAX_ONLY, UNCONCEAL) o F$VERIFY ([procedure], [image]) - new image argument o Protection strings - new consistent format o UIC strings - new format Miscellaneous DCL Changes o Can access relative files from DCL o Depth of command procedure nesting increased from 8 to 16 o Captive processes check for login command procedures o PIOPAGES sysgen parameter to set size of RMS process IO segment o DCL broadcast class for CTRL/T and SPAWN/NOTIFY ENHANCEMENTS TO COMMAND PARSING Value type definitions o Function: Specify allowable syntax of a command value o Types: Built-in e.g., QUALIFIER listing,VALUE(TYPE=$FILE) User-defined e.g., PARAMETER p1,VALUE(REQUIRED,TYPE=options) o Built-in types: $ACL $NUMBER $DATETIME $QUOTED_STRING $DELTATIME $REST_OF_LINE $FILE Value type definitions - continued o Example of use of type definitions DUMP /BLOCKS=(START:0,END:256) FOO DEFINE TYPE dump_limits KEYWORD start,VALUE(TYPE=$NUMBER) KEYWORD end,VALUE(TYPE=$NUMBER) KEYWORD count,VALUE(TYPE=$NUMBER) DEFINE VERB dump PARAMETER p1,PROMPT="File",LABEL=input_file, VALUE(REQUIRED,TYPE=$FILE), QUALIFIER ascii QUALIFIER blocks,VALUE(LIST,TYPE=dump_limits) QUALIFIER records,VALUE(LIST,TYPE=dump_limits) ... Disallow Statements o Function: Specify disallowed combinations of command elements o Syntax: DISALLOW boolean-expression o Operands: Command element specifications entity-name.entity-name... o Operators: AND, OR, NOT, NEG, ANY2(), and parentheses Disallow Statements - continued o Example of use of DISALLOW statements DUMP /BLOCKS=(START:0,END:256,COUNT:10) FOO DEFINE TYPE dump_limits KEYWORD start,VALUE(TYPE=$NUMBER) KEYWORD end,VALUE(TYPE=$NUMBER) KEYWORD count,VALUE(TYPE=$NUMBER) DEFINE VERB dump PARAMETER p1,PROMPT="File",LABEL=input_file, VALUE(REQUIRED,TYPE=$FILE), QUALIFIER ascii QUALIFIER blocks,VALUE(LIST,TYPE=dump_limits) QUALIFIER records,VALUE(LIST,TYPE=dump_limits) ... DISALLOW blocks AND records DISALLOW blocks.end AND blocks.count DISALLOW records.end AND records.count Miscellaneous CDU Changes o Faster parsing of command tables o Better error checking and reporting at compile time o Forward DEFINE TYPE and DEFINE SYNTAX references allowed Miscellaneous CDU Changes - continued o Parameter definitions must be copied to syntax changes *** THIS IS AN INCOMPATIBLE CHANGE *** Version 3.0 Version 4.0 ----------- ----------- DEFINE VERB foo DEFINE VERB foo PARAMETER p1,LABEL=first PARAMETER p1,LABEL=first QUALIFIER x,SYNTAX=change QUALIFIER X,SYNTAX=change DEFINE SYNTAX change DEFINE SYNTAX change PARAMETER p1,LABEL=? PARAMETER P1,LABEL=first PARAMETER P2,LABEL=second o Incompatible table format Recreate command tables whenever possible Automatic run-time conversion by CLI$DCL_PARSE Enhancements to CLI$ Routines CLI$DCL_PARSE (command-string, table, [param-routine], [prompt-routine], [prompt-string]) Argument Description -------- ----------- command-string Command to parse table Address of tables containing the command definition param-routine Used to prompt for missing parameters prompt-routine Used to prompt for initial command line and continuation lines prompt-string Used by prompt-routine Enhancements to CLI$ Routines - continued CLI$DISPATCH ([user-argument]) o User-argument is passed directly to action routine Enhancements to CLI$ Routines - continued CLI$PRESENT (name-desc) CLI$GET_VALUE (name-desc, buffer-desc, [ret-length]) o Support keyword parsing IF CLI$PRESENT ("BLOCKS.START") THEN CLI$GET_VALUE("BLOCKS.START", RETDESC) o RTL input and output descriptor support STR$ANALYZE_SDESC, STR$COPY_DX o CLI$GET_VALUE returns optional return value length o New return statuses