Académique Documents
Professionnel Documents
Culture Documents
Symbols, Logicals and Lexicals..........................................................................9 IF - THEN - ELSE Command............................................................................10 SEARCH Command..........................................................................................11 Error Handling Commands................................................................................11 Command Procedure .......................................................................................12 @ And SUBMIT Command ..............................................................................12 ABBREVIATIONS..............................................................................................13
1. Introduction to VAX/VMS
The VAX and Alpha machines run an operating system called VMS. A typical VMS cluster system consists of Digital VAX or Alpha computers which communicate with each other via Ethernet link. After logging into the VMS system every user will have own personal directory. After successfully logging into the system the users can see the command prompt generally be the $ dollar sign or the node name (the name by which the computer is known to the network) followed by a dollar or > sign. Users may log in (open sessions) more than once under the same. There is no difference between Open VMS and VMS. It was just a marketing name change.
VAX/VMS Commands
SHOW CLUSTER This command is used to obtain the list of the VMS cluster machines. SHOW NETWORK This command is used to obtain machine details on the network LOGOFF or LOG This command is used to logoff from the current system MAIL The VAX/VMS mail utility allows the users to send and receive messages to other users on the same VAX system or any other computer that is connected to Decnet. Users can read, forward, delete, print and reply to messages that other users sent. It can be used as a better communication tool between offshore and onsite. Ex: $MAIL To invoke the mail utility, it will give the MAIL> command prompt where users can issue any of the mail commands. MAIL>SEND To: node name/username To send a message to another user/users MAIL>READ [message number] - To read the messages that the users has received MAIL>FORWARD - To send a copy of message users has currently reading to other users MAIL>REPLY - To send reply to user from whom you have received message. MAIL> SET CC-PROMPT - To set carbon copy (CC) prompt, to appear while sending messages to other users. MAIL>EXIT - To exit from MAIL utility option. SET PASSWORD To change the current password of the system. SET HOST Using this command, user can switch between different tasks or processes. EX. $SET HOST <node number> It will ask for user id and password of new node and connect to that new node from the existing node. When you logoff from the new node then you will be back to the first node.
PHONE To invoke the PHONE utility program that allows the user to communicate with other users. Just like online chatting. Ex. $PHONE <user2> The specified user gets intimation that <user1 from which u r getting call> is phoning you. Then User2 can respond to the call by $PHONE ANSWER To attend the call EXIT To exit from the chat
Introduction to DCL
The Digital Command Language (DCL) is the language used to communicate with the VMS operating system. You can use DCL to Get information about the system Work with files and directories Work with disks, tapes, and other devices Modify your work environment Develop and execute programs
$HELP It will ask you for any Topic? , Subtopic? To exit from HELP, press <Return> repeatedly. Ex: $HELP PURGE To create new directories or subdirectories. $ CREATE/DIRECTORY directory-spec [,...] To create a subdirectory called SUBDIR1 under the current directory $ CREATE/DIR [.SUBDIR1] Ex. $ CREATE/DIRECTORY DISK2: [<username>.sub] This command creates a subdirectory named [<username>SUB]. This directory file is placed in the directory named [<username>]. To change the current default directory to user specified disk and directory $SET DEF/DEFAULT DISK:[<specific directory>] Ex. $SET DEF DKA100:[Release_src] To change to the directory above your current directory: $ SET DEF [-] Let us assume that current directory is RMS_1:[DEVELOPMENT.DEVUSR01.RELEASE_SRC] After issuing of $SET DEF[-] command the directory becomes RMS_1:[DEVELOPMENT.DEVUSR01] To change to your home/login directory, no matter what directory you are in: $ SET DEF SYS$LOGIN To run any process/program $ RUN <process/program executable name> Ex. $RUN TEST1.EXE
Naming Files Creating a file $ CREATE filespec [,...] Ex. $ CREATE TFILE.TXT Accepts lines for TFILE.TXT Finally press <Ctrl/Z> to save the input contents into TFILE.TXT Appending Files The APPEND command adds the contents of one or more files to the end of another file. $ APPEND input-filespec[,...] output-filespec Ex. $ APPEND TEST3.DAT TESTALL.DAT Appends TEST3.DAT to the end of TESTALL.DAT $ APPEND FILE1.DAT, FILE2.DAT FILE3.DAT To append FILE1.DAT and FILE2.DAT to the end of FILE3.DAT Deleting and Purging Files The DELETE command can delete one or more files from your directory. The PURGE command deletes all but the highest number (i.e. latest) version of the specified file(s). It is recommended that you always specify a version number when deleting files. To Delete a file $ DELETE filespec[,...] Ex. $ DELETE *.OLD;* The DELETE command deletes all versions of files with file type .OLD from the default disk directory. $ DELETE ALPHA.TXT;*, BETA;*, GAMMA;* The DELETE command deletes all versions of the files ALPHA.TXT, BETA.TXT, and GAMMA.TXT. The command uses the file type of the first input file as a temporary default. $DELETE FILE1.DAT;1 Deletes version 1 of FILE1.DAT To delete all but the highest numbered versions of the specified files. $PURGE [filespec[,...]] /LOG /LOG gives information whether file specifications are deleted or not. EX. $ PURGE The PURGE command in this example deletes all but the highest numbered version of all files in the default directory. $ PURGE *.COM The PURGE command in this example deletes all but the highest numbered version of each file with a file type of .COM. Filenames in VMS are always in the form "filename.extension;version#" A semicolon (;) or period (.) must preceed the version number. Names and types may be up to 39 characters (including the following characters: letters, numbers, -, _, $) Do not use a hyphen as the first or last character. Do not start a filename with the $. File types are optional, but in some cases the system will add a default type.
Editing a file $ EDIT filename If the file already exists, the contents of the latest version of the file will be displayed. When you save the file, a new version will be created and the NAME.TYPE will be the same, but the system will increase the version number by 1. If the file does not exist, the file will be created with the version number specified as 1. Ex. To edit version 3 of FILE1.DAT $ EDIT FILE1.DAT;3 Setting Protection To prevent or allow others to access your files and directories, you can change the protection on files and directories. Protection is set for the system (S), owner (O), group (G), and world (W). You must be the owner of the file/directory for which you want to change the protection. Syntax: $SET PROTECTION[=(code)]/DEFAULT /DEFAULT - Establishes the default protection for files created by the current process. Code The desired protection to be set. To display the protection on a file: $ DIR/PROT filename.type To set the protection for all versions of a file: $ SET PROT=(S:RWED, O:RWED, G:R, W:R) filename.type;* Sorting and Merging of Files The OpenVMS Sort/Merge utility sorts records or merges input files. To sort one or more input files, specify the SORT command. These files are sorted according to the fields you select and one reordered output file is generated. $ SORT input-file-spec [,...] output-file Ex. $SORT FILE1.TXT, FILE2.TXT OUTFILE.TXT To merge input files that have previously been sorted according to the same key fields, specify the MERGE command. One output file is generated. $ MERGE input-file-spec [,...] output-file Ex. $MERGE FILE1.TXT, FILE2.TXT OUTFILE.TXT Opening a file OPEN command opens a file for reading, writing, or both; assigns a logical name to a filespec (file/device) and places the name in the process logical name table $ OPEN <logical-name> <filespec> Options: /APPEND - Opens an existing file for writing and positions the record pointer at the end-of-file (EOF). New records are added to the end of the file /ERROR=label - Transfers control to the location specified by the label keyword (in a command procedure) if the open operation results in an error. /READ (default) - Opens the file for reading. If you specify the /READ qualifier without the /WRITE qualifier, you must specify an existing file
/SHARE=<option> - Allows other users to read or write. You may specify /SHARE=READ to allow others to read (R) but not write (W). If you specify the /SHARE=WRITE or the /SHARE qualifier with no option, users are allowed read and write. If the /SHARE qualifier is not present, other users are allowed only read access to the specified file /WRITE - Opens the file for writing. If file type already exists, a new file with a version number one greater than the existing file is created. Use the /READ qualifier with the /WRITE qualifier to open an existing file. You cannot use OPEN/READ/WRITE to create a new file. The /WRITE and the /APPEND qualifiers are mutually exclusive. Ex. $ OPEN/WRITE/ERROR=OPEN_ERROR OUTPUT_FILE TEMP.OUT $ OPEN_ERROR: $ WRITE SYS$OUTPUT "Cannot open file TEMP.OUT" $ EXIT Closing a File CLOSE command closes a file opened with the OPEN command and deassigns the associated logical name. Syntax: $CLOSE <logical-name> Options: /ERROR=label - Specifies a label in the command procedure to receive control if the close operation results in an error. Overrides any ON condition action specified. If an error occurs and the target label is successfully given control. /LOG (default) /NOLOG - Generates a warning message when you attempt to close a file that was not opened by DCL. If you specify the /ERROR qualifier, the /LOG qualifier has no effect. If the file has not been opened by DCL, the error branch is taken and no message is displayed. EX. $ CLOSE/ERROR=CLOSE_ERROR OUTPUT_FILE . $ CLOSE_ERROR: $ WRITE SYS$OUTPUT "Cannot close file OUTPUT_FILE" $ EXIT Writing a record into a File WRITE - Writes the specified data (expression) as one record to an open file specified by a logical name Syntax:$ WRITE <logical-name> <expression> Options: /ERROR=label - Transfers control on an I/O error to the location specified by label (in a command procedure). If no error routine is specified and an error occurs during the writing of the file, the current ON condition action is taken. The /ERROR qualifier overrides any ON condition action specified. /SYMBOL - Causes the expression to be interpreted and its expanded value placed in a 2048byte (instead of a 1024-byte) buffer before the write operation is performed. If you specify multiple expressions, their values are concatenated and placed in the 2048-byte buffer. Use the /SYMBOL qualifier to write a very large record. Each expression specified must be a symbol. You cannot specify character string expressions. /UPDATE - Replaces the last record read with the record specified with the expression parameter. You must be able to read and write to a file to use the UPDATE qualifier. Use the WRITE/UPDATE command only after a READ command. The WRITE/UPDATE
EX. $ OPEN/WRITE OUTPUT_FILE1 TESTFILE1.DAT $ OPEN/WRITE OUTPUT_FILE2 TESTFILE2.DAT $ WRITE/ERROR=WRITE_ERROR OUTPUT_FILE1 "HELLO WORLD" $ A = "HELLO" $ B = "WORLD" $ WRITE/SYMBOL OUTPUTFILE2 A,B $ CLOSE OUTPUTFILE1 $ CLOSE OUTPUTFILE2 $ EXIT $ WRITE_ERROR: $ WRITE SYS$OUTPUT "There was a WRITE error." $ CLOSE OUTPUTFILE1 $ EXIT Copying an existing file contents into a new file COPY - Creates a new file from one or more existing files. Syntax: $COPY <input-filespec> <output-filespec> Options: /LOG - When you use the /LOG qualifier, the COPY command displays the file specifications of the input and output files, the number of blocks or the number of records copied, and the total number of new files created /PROTECTION=(<ownership>:<access>[,...]) where, <ownership> - system (S), owner (O), group (G), or world (W). <access> - read (R), write (W), execute (E), or delete (D) /FTP <input-filespec> <output-filespec> - Transfers files between hosts with possibly dissimilar file systems over a TCP/IP connection by invoking the FTP utility. EX. $COPY/FTP/LOG INFILE.PDF PRIMENT13::"/DIRECT4/EPS_PDF/" $COPY/PROT=(W:RWED,S:RWED,G:RWED,O:RWED) INFILE.TXT OUTFILE.TXT
Logical is commonly used to save time by assigning a "nickname" (logical name) to any file, directory, or device (printer, disk) specifications that you use frequently. $ DEFINE logical SPECIFICATION The DEFINE command creates a logical name which represents one or more equivalence names. An equivalence name can be a device name, another logical name, a file specification, or any other string. The use of a logical name can be limited to a process, a job, or a group, or it can be used by an entire system or an entire Open VMS Cluster system. It depends on the table in which the logical name is created, which you specify with one of the following qualifiers: /PROCESS, /JOB, /GROUP, /SYSTEM, or /TABLE. /JOB - Places the logical name in the jobwide logical name table. All processes in the same job tree as the process that created the logical name can access the logical name. The /JOB qualifier is synonymous with the /TABLE=LNM$JOB qualifier /PROCESS (default) - Places the logical name in the process logical name table. The /PROCESS qualifier is synonymous with the /TABLE=LNM$PROCESS qualifier. /SYSTEM - Requires write (W) access or SYSNAM (system logical name) privilege to place a name in the system logical name table. Places the logical name in the system logical name table. All system users can access the logical name. The /SYSTEM qualifier is synonymous with the /TABLE=LNM$SYSTEM qualifier. /TABLE=name - Requires write (W) access to the table to specify the name of a shareable logical name table. Specifies the name of the logical name table in which the logical name is to be entered. You can use the /TABLE qualifier to specify a user-defined logical name table (created with the CREATE/NAME_TABLE command) Ex. $ DEFINE SYS$SCRATCH POWSUB The DEFINE command places the logical name SYS$SCRATCH in the process logical name table with an equivalence name of POWSUB. Lexical is a collection of functions that return information about character strings and attributes of the current process. The commonly used functions are: 1. F$EXTRACT - Extracts the specified characters from the specified string. Syntax: $F$EXTRACT(start, length, string) 2.F$TIME - Returns the current date and time in absolute time format. 3.F$STRING - Returns the string that is equivalent to the specified expression. 4. F$TRNLNM - Translates a logical name and returns the equivalence name string or the requested attributes of the logical name specified. 5. F$LOCATE - Locates a specified portion of a character string and returns as an integer the offset of the first character. 6. F$EDIT - Edits the character string based on the edits specified in the edit-list argument. Syntax: F$EDIT(string, edit-list) 7. F$LENGTH - Returns the length of the specified character string. Syntax: F$LENGTH(string) Ex. $ CURR_DATE = F$TIME() $ MONTH = F$EXTRACT(3,3,CURR_DATE) $ MONTH_NUM = F$LOCATE(MONTH, MONTHS) $ MONTH_STR = F$EXTRACT(1,2,F$STRING(MONTH_NUM/3 + 100))
One or more commands following the $ELSE command if the expression is false
Syntax: $ IF expression THEN [$] command (or) $ IF expression $ THEN [command] command $ [ELSE] [command] command $ ENDIF Ex. $ COUNT = 0 $ LOOP: $ COUNT = COUNT + 1 $IF COUNT .LE. 10 THEN GOTO LOOP $ELSE $ WRITE SYS$OUTPUT COUNT $ EXIT
SEARCH Command
This command is used to search specified string with in specified files of specified directory. $ SEARCH filespec[,...] search-string[,...] (or) $SEARCH <DIR> <File or Files> <Search string> Ex. $ sear dka100:[release_src]*.sco Date It will give the search results of Date string present in release_src] directory of *.SCO files $ SEARCH/OUTPUT=RESULTS.DAT DISLIST.TXT NAME The SEARCH command searches the file DISLIST.TXT for occurrences of the character string NAME and sends the output to the file RESULTS.DAT.
1.$ON ERROR THEN GOTO ERROR_LABEL - here error_label is a label name where u can issue any messages when the specified error encounters during execution of a job. 2.$ ON ERROR THEN GOTO QUIT $QUIT: $EXIT terminates processing of command procedure or subroutine and returns to calling command.
Command Procedure
A command procedure is a set of DCL commands written in a file with the extension COM. The commands stored in this file will be executed sequentially.
To see the status/list of all the jobs in the batch queue $SHOW QUEUE/ALL SYS$BATCH It will list the job status as Entry Jobname Username Status ----- ------------------TELERUN DEVUSR01 Executing 689
To delete any specific job entry which is already submitted for execution or which is executing at present $ DELETE/ENTRY=<Job Entry Number> Ex. DELETE/ENTRY=689 this will give the following message Job TELERUN (queue SYS$BATCH, entry 689) terminated with error status %JBC-F-JOBABORT, job aborted during execution
Abbreviations
VMS VAX DEC Directory Command Procedure Virtual Memory System Virtual Address eXtension. Digital Equipped Command Directory means folder in PC A set of DCL commands stored in a file always the extension is filename.COM.