The 'at' sign (@) means "execute" in RDO, just as in DCL. When you type @ and the name of an indirect command file, RDO executes the statements in the file as if you had typed them one at a time at the RDO prompt. The default file type for an indirect command file is RDO. You can use the SET VERIFY statement to have the commands in the file displayed on the screen as they execute. Example: $ TYPE ACCOUNTING.RDO INVOKE DATABASE FILENAME "DEPT3:ACCOUNTING" SHOW DATABASES $ RDO RDO> @ACCOUNTING Database with filename ACCOUNTING
1 – Format
@file-spec file-spec The name of an indirect command file. You can use either a full OpenVMS file specification, a file name, or a logical name. If you use a file name, RDO looks in the current default OpenVMS directory for a file by that name. The file must contain valid RDO statements.
2 – More
You do not need any special Oracle Rdb privileges to use the EXECUTE statement. You can use the SET VERIFY statement to have the commands in the file displayed on the screen as they execute. RDO recognizes a special RDO command file called RDOINI.RDO, which contains RDO statements to be issued before RDO displays the RDO> prompt. If this file exists, RDO executes the commands in that file first, before displaying the prompt and accepting your input. If you have defined the logical name RDOINI to point to a general initialization file, RDO uses this file. Otherwise, it looks for RDOINI.RDO in the current default directory.
3 – Examples
Example 1 Use an indirect command file to execute a frequently used query: $ TY EMPADDR.RDO ! ! This command file generates information for a mailing list. ! INVOKE DATABASE FILENAME 'DISK2:[DEPT32]MF_PERSONNEL.RDB' SET OUTPUT 'DISK2:[DEPT32]MAILLIST.DOC' FOR E IN EMPLOYEES PRINT E.FIRST_NAME, E.MIDDLE_INITIAL, E.LAST_NAME, E.ADDRESS_DATA_1, E.ADDRESS_DATA_2, E.CITY, E.STATE, E.POSTAL_CODE END_FOR $ RDO:== $RDO $ RDO RDO> @EMPADDR Example 2 You can use a logical name to run a command file: $ SET DEFAULT DISK1:[FORESTER] $ DEFINE COUNT "DISK2:[DEPT3]COUNT.RDO" $ TYPE DISK2:[DEPT3]COUNT.RDO ! ! This command file counts the records in ! each relation in the MF_PERSONNEL database. ! SET NOVERIFY SET OUTPUT COUNT.LOG INVOKE DATABASE FILENAME 'DISK2:[DEPT3]MF_PERSONNEL.RDB' PRINT " " PRINT "Statistics for the MF_PERSONNEL database follow: " PRINT " " PRINT "Count of Employees -------> ", COUNT OF X IN EMPLOYEES PRINT "Count of Jobs ------------> ", COUNT OF J IN JOBS PRINT "Count of Degrees ---------> ", COUNT OF D IN DEGREES PRINT "Count of Salary_History --> ", COUNT OF SH IN SALARY_HISTORY PRINT "Count of Job_History -----> ", COUNT OF JH IN JOB_HISTORY PRINT "Count of Work_Status -----> ", COUNT OF W IN WORK_STATUS PRINT "Count of Departments -----> ", COUNT OF D IN DEPARTMENTS PRINT "Count of Colleges --------> ", COUNT OF C IN COLLEGES PRINT "Count of Resumes ---------> ", COUNT OF R IN RESUMES PRINT " " PRINT "Statistics Complete for Database - written to COUNT.LOG" PRINT " " PRINT " " $ ! $ RDO:== $RDO $ RDO RDO> @COUNT Statistics for the PERSONNEL database follow: Count of Employees -------> 100 Count of Jobs ------------> 15 Count of Degrees ---------> 166 Count of Salary_History --> 729 Count of Job_History -----> 274 Count of Work_Status -----> 3 Count of Departments -----> 26 Count of Colleges --------> 16 Count of Resumes ---------> 0 Statistics Complete for Database - written to COUNT.LOG RDO> Notice that the default OpenVMS directory is not the same as the directory containing the command file. You define the process logical name to point to the correct command file. Then you use the logical name as the object of the @ command.