Chapter 9:  System Files

System Files (SF) can contain any line that can be entered at the terminal:  Interactive Command Language (ICL) commands, edit commands, text, and data.  Because of their flexibility, SF’s serve a variety of purposes in ACCENT R.  They can be output files for reports and for the SHOWING clause when the SAVE option is invoked.  They can serve as data input files to create or append data to Data Sets (DS).  They can also be used as statement input files to create Schema Definitions (SD), Process Modules (PM), Command Modules (CM), Global Storage (GS), Data Base Libraries (DBL), and other SF’s.  They can work as log files to document terminal sessions.  They are useful as command and startup files.  Several of these functions can even be combined in one System File.

ACCENT R assigns all System Files with the extension .TMP to SYS$SCRATCH on OpenVMS.

This discussion does not intend to reflect all possible uses of SF’s.  Since SF’s can interact with CM’s and PM’s, their uses are limited only by the ingenuity of the user.

This chapter first discusses accessing SF’s and default extensions.  It then presents the use of SF’s as output files, how to create them, their use as input files, use as command files, and finally combining functions in one SF.

Accessing System Files

Any System File (SF) can be accessed, whether it is cataloged in the current Data Base Library (DBL) or not.

SF’s are invoked with the USE command:

*USE SF name.ext

or the USE edit command:

*USE /SF/ name.ext

The contents of any SF can be displayed at the terminal with the command form:

*LIST SF name.ext

Default Extensions

System File (SF) names include a dot and an extension.  When ACCENT R creates an SF, it assigns an extension by default if the user does not supply one.  Table 9-1 summarizes default extensions.

Command

Extension

Define SF

CMD

Show Clause

DAT

Use SF Log

LOG

Relate SF Name

REP

Enter Errors To

ERR

Create DBL

DBL

Create DS

DS

Define DI

DI

Keep FS

FS

Table 9-1 Default Extensions on Output System Files

When existing SF’s are accessed, ACCENT R expects specific extensions, depending on the command.  Table 9-2 lists commands and their expected SF extension.  If the file has that extension, it need not be expressed in the command.  If the file has any other extension, then it must be expressed.

Command

Extension
Expected

Enter

.DAT

Load

.DAT

Create SF Attach

.CMD

Use SF

.CMD

List SF

.CMD

Create DS Attach

.DS

Restore FS

.FS

Table 9-2 Extensions Expected on Input System Files

Example

*EXTRACT SHOW PRICE SAVE ON COST

The file cost is created and has the default extension .DAT.  That extension must be supplied when the file is listed.

*LIST SF COST.DAT

If the SF is created with the extension .CMD, then it can be listed without the extension, since LIST assumes .CMD by default.

*EXTRACT SHOW PRICE SAVE ON COST.CMD
*LIST SF COST

When a report file is named without an extension, ACCENT R assigns the extension .REP, and the file name must be followed by the extension when it is listed.

*REPORT VIA MO.END REPORT 1 to ORDERS
*LIST SF ORDERS.REP

ACCENT R assigns all temporary files to the logical name SYS$SCRATCH.  SYS$SCRATCH can be assigned to a separate directory that is shared by many users.  This technique can reduce the overall need for disk space used by ACCENT R users.  Also, SYS$SCRATCH can be mapped to a high-performance disk device or RAM disk device.

System Files for Output

Several ACCENT R commands and statements make use of System Files (SF) for output.  A report produced by a Process Module (PM) can be assigned to an SF. The SAVE option of the SHOWING clause stores extracted data on a SF if the SAVE ON clause is specified.  Log files are used to record terminal sessions.  In addition, any ACCENT R object can be copied to an SF.

Reports

Reports can be directed to a System File (SF) when a Process Module (PM) is executed.  These files can be listed from ACCENT R or at system level.  Reports generally are created or presenting data, often with headings and subheadings, totals, and other special features that contribute to the presentation.  However, reports can also serve as the basis for creating Data Sets (DS).

A report file is named in a RELATE statement of a PM.  If an extension other than .CMD is included in the name, the extension must also be given when the file is later displayed.

Example

00120 RELATE SF PRICE.ONE AS REPORT 1
*LIST SF PRICE.ONE

If the name assigned in the RELATE statement does not include an extension, ACCENT R assigns the extension .REP by default.  To list such a file, the name must be followed with the extension.

00120 RELATE SF PRICE AS REPORT 1
*LIST SF PRICE.REP

Data Extraction

When the SAVE option of a SHOWING clause is used with one of the Data Manipulation commands, the output is saved on a System File (SF).

The default extension on a SAVE file is .DAT.  When a save file having the default extension, or any extension other than .CMD, is listed, the extension must be given.

Example

Saving an SF with the default extension (.DAT) which must be specified for listing.

SHOW ALL SAVE ON STAT
*LIST SF STAT.DAT

Specify a different extension for the save operation.  The .CMD extension is NOT needed for the listing.

SHOW ALL SAVE ON STAT.CMD
*LIST SF STAT

NOTES:  The output file from a SHOWING clause can be used as an input file to create or add data to a Data Set (DS).  Such an SF is also available for use outside ACCENT R.

Log Files

A log file is an exact record of every line entered to the terminal, along with every line displayed at the terminal by ACCENT R.  The only things not saved on the log file are SLIM line editing characters.  Recording in a log file begins when entering a form of the USE command.

SYNTAX

USE SF name [.ext] /AS/ LOG [ONLY] [APPEND]

name

specifies the name of the System File (SF).

ext

if no extension is entered, it defaults to .LOG.

ONLY

suppresses displaying information on the terminal.

APPEND

adds new entries to an existing SF.

Example

*USE SF WORK1 AS LOG

To stop recording the terminal session on the LOG file, enter the command:

*USE NO SF LOG

Or leave ACCENT R with the LINK or QUIT command.

NOTES:  If DISABLE WARNING MESSAGES is in effect, warning messages will be suppressed both at the terminal and on the log file.

When a log file is recording and if an SF is called with the USE command, every line of the SF will record in the log file as it is executed, since an SF is treated as terminal input.  However, if a Command Module (CM) or Process Module (PM) is called while a log file is recording, the lines in the CM or PM will not be put in the log file, only the normal output will be recorded.

A log file is a useful document if a problem is encountered, particularly if using a terminal.  The exact record of what has been happening can be of value in isolating problems.  Log files can also serve as input for many purposes.

Saving ACCENT R items on System Files

All ACCENT R objects except Data Sets (DS) and Find Subsets (FS) can be copied to a System File (SF) with the COPY command for later listing or for use outside ACCENT R.  The object is copied as ASCII text, not as compiled code.  An SF can also be copied to another SF.

Example

*COPY SD BOOKS_DBM2 TO SF BOOKS.A
*COPY PM YTD_SALES_DBM2 TO SF SALES.B
*COPY SF TEST.DS TO SAVE_TEST.DS

DEFINE SF  and MODIFY SF Commands

System Files (SF) can be created in ACCENT R with the DEFINE SF command, and they can be modified with the MODIFY or EDIT commands.  MODIFY invokes ACCENT R's Text Editor (TED).  EDIT invokes the user's local editor specified in the system field @EDITOR.

SF’s can be created outside ACCENT R by other programming languages or interactively in the system editor.  Any SF that can be accessed can also be declared from inside ACCENT R.

Cataloging in a DBL

Any System File (SF) can be cataloged in a Data Base Library (DBL).

Example

The form for a newly created SF is:

DEFINE SF name IN DBL

Any existing SF can be cataloged in a DBL by using the command form:

CREATE SF name IN DBL ATTACH

NOTES: An SF can be cataloged in more than one DBL. An SF can be used whether cataloged in a DBL or not.

The REMOVE SF Command

Any System File (SF), whether cataloged in a Data Base Library (DBL) or not, can be deleted with the REMOVE SF command.  The REMOVE command also removes the entry for an SF from the current DBL, but not from any other DBL if it is cataloged in other DBL's.

Line Numbers

A System File (SF) created with DEFINE or MODIFY command is saved without line numbers.

An SF cannot be SAVEd with line numbers, but one can be created by following the procedure below:

    1. Open a log file to trace terminal activity.  (USE SF logfile_name LOG).
    2. Use the TED editor to assign line numbers (automatically) to the SF to be numbered (MODIFY SF file.ext).
    3. List the SF with its assigned line number.  The log file will capture the listing.
    4. Exit the TED editor.  (Enter the STOP command at the subcommand level prompt).
    5. Close the log file.  The log file must be closed in order to LIST it.  Otherwise, a "waiting...busy" message will be displayed.  (USE NO SF LOG).
    6. List the log file to see the numbered lines.  (LIST SF logfile.LOG).

When an SF is USE’d for input into the editor, line numbers identify data.  Edit commands cannot have line numbers if they are to be executed.  If combining edit commands and data lines in a System File, there are two possible courses of action:

Put line numbers on the data lines, but do not put line numbers on the edit command lines.  In most editors, this would mean manually entering numbers for all of the lines that are data.

Precede lines of data with INSERT and follow them with END, then save the whole file without line numbers.  See example.

Example

The two SF’s shown below will create identical Schema Definitions (SD) when invoked with the USE SF edit command.  Both SF’s combine edits commands and data in one file.  SF NONUMB does not contain any line numbers, and so uses the INSERT and END edit commands so that ACCENT R will supply the line numbers needed for data lines for editing only.  The second SF

SOMNUM, has line numbers on the data lines, but not on the edit command lines.

*LIST SF NONUMB.DAT
INSERT
FLDA,CHAR,2
FLDB,INT,3
END
PRINT
SAVE
*LIST SF SOMNUM.DAT
10 FLDA,CHAR,2
20 FLDB,INT,3
PRINT
SAVE

The two SF’s are invoked at edit level, and then the resulting SD’s are listed.  Note that the procedures and the results are identical.

*DEFINE SD NONUMB
—USE SF NONUMB.DAT
00010 FLDA,CHAR,2
00020 FLDB,INT,3
*LIST SD NONUMB
00010 FLDA,CHAR,2
00020 FLDB,INT,3
*DEFINE SD SOMNUM
USE SF SOMNUM.DAT
00010 FLDA,CHAR,2
00020 FLDB,INT,3
*LIST SD SOMNUM
00010 FLDA,CHAR,2
00020 FLDB,IINT,3

NOTES: Commands in SF’s cannot have line numbers.  Data in an SF with ENTER or LOAD cannot have line numbers.

System Files for Input

Data can be moved from System Files (SF) to Data Sets (DS) in one of three ways:

A fourth command, CREATE…ATTACH can make an existing SF available as a DS.

SF’s can also be used at edit level to enter text to an ACCENT R object.

The ENTER Command

The ENTER command requires an input file in which data is in the same form as it would be entered at the terminal.

Example

For example, instead of entering data interactively, a System File (SF) could be created that contains data for the appropriate fields, separated by commas.

*LIST SF PUB.CMD
2011, Bay Books, San Francisco, CA
3015, Midwest Publications, Chicago, IL
3226, New England Press, Boston, MA
*USE DS PUBLISHERS_DBM2
*ENTER FROM PUB.CMD
*EXTRACT
2011 Bay Books San Francisco CA
3015 Midwest Publications Chicago IL
3226 New England Press Boston MA

If the SF has the extension .DAT, the extension need not be expressed.  Any other extension must be given in the command.

*ENTER FROM PUB

is equivalent to

*ENTER FROM PUB.DAT

The LOAD Command

The LOAD command is used to create or append to a Data Set (DS) from a formatted ASCII System File (SF).  LOAD is generally used when the form of the data does not match the Schema Definition (SD) of the DS to which the SF will be copied.

If the SF has the extension .DAT, the extension need not be expressed.  Any other extension must be given in the command.

After data is entered into a DS with LOAD, the SF still exists.  If no longer needed, it can be deleted from within ACCENT R with the REMOVE SF command..

Example

Loading data from a SF.  The DS is declared prior to the LOAD.

*USE DS STOCK
*LOAD FROM DAT.CMD FIELDS ITEM_NO,4 ITEM_DESC

The example below deletes an unwanted SF.

*REMOVE SF name.ext

The ACCEPT Statement

An ACCEPT statement takes data from any declared System File (SF) by default. A CM can declare a SF with the command USE SF.  If a PM is to take data from an SF, the SF must be declared with the USE SF command before the PM is called.  When the USE SF command is entered interactively, ACCENT R immediately attempts to execute the SF.  However, when a CM declares an SF, the SF is accessible, but control remains in the CM.  When an accept command is encountered, the data will be read from the SF.  When a PM is to take data from an SF, both the SF and the PM should be declared from a CM or the PM called from the SF.

The default condition of taking data from any open SF can be overridden by the DISABLE SF DATA INPUT command.

The CREATE...ATTACH Command

The CREATE DS command with the ATTACH option requires an existing file whose form exactly matches the Schema Definition (SD) of the Data Set (DS).  The existing file simply gets an entry as a DS in the current Data Base Library (DBL), and can then be used as a normal DS. CREATE…ATTACH does not check the format of the data against the SD, so it is important to be sure that the attached DS's data exactly matches the fields of the SD.

A System File (SF), created by the SHOWING and SAVE on clauses, could be defined as a data set.

Example

*LIST SD SALES_DBM2
00010 STORE_CODE,CHAR,4
00020 ORD_NUM,CHAR,20
00030 ORD_DATE,FULLDATE
00040 QTY,INT,6
00050 PAY_TERMS,CHAR,12
00060 TITLE_CODE,CHAR,6

To create a DS containing only two fields (order number and qty), use the commands:

*USE DS SALES_DBM2
*EXTRACT SHOW ORD_NUM,QTY SAVE ON ORDER.DS

The simplest way to create the DS is

*DEFINE SD ORDERS
INSERT 1,1
FORM IS ASCII
ORD_NUM, CHAR, 4
QTY, INT, 6
END
--SAVE
*CREATE DS ORDERS SD ORDERS ATTACH

NOTES:  The SHOWING clause converts binary data to ASCII.  Therefore, when the output from a SHOWING clause is used as a DS, the fields must be defined as ASCII.

System Files used at the EDIT Level

System Files (SF) can contain the statements used to define DBL objects such as Process Modules (PM), Command Modules (CM), Global Storage (GS), and other SF’s.  The command USE SF can be used at edit level as well as command level.

Example

The following example shows a System Files then uses it to create a Schema Definition (SD).

*LIST SF INPUT
INSERT 1,1
LETTER, CHAR, 10
INTEGERS, INT, 10
DECIMAL, FLOAT, 10, 2
END
SAVE
*DEFINE SD CHAR
--USE SF INPUT
*LIST SD CHAR
00001 LETTER, CHAR, 10
00002 INTEGERS, INT, 10
00003 DECIMAL, FLOAT, 10, 2

System Files for Command Control

System Files (SF) that contain commands are governed by the following conventions.

SF’s can contain any ACCENT R command.  If the command STORE is used in an SF, it must include the option NEXT.  Several commonly used commands could be stored in an SF with the STORE NEXT AS name command.  After declaring the SF, any of the commands could be invoked with the INVOKE name command.

The TYPE and ACCEPT commands are permitted.  System fields, declared Global Storage (GS) fields, literals, constants, functions, and expressions thereof can be included in the TYPE list.

An SF cannot contain the control statements IF, UNLESS, START, LEAVE, or REPEAT.  Execution of any line in the file cannot be conditional unless the command on that line can itself contain a conditional expression.

Example

TYPE @ERROR_MESSAGE IF @ERROR_NUMBER #0
SET 0 TO @INTEGER(1) IF @STRING(1) = 'NO'

Data Set (DS) fields, GS fields, and system fields can be referenced where the syntax of the line permits.

SF’s are not compiled when they are saved.  The only way to check a command file for syntax or semantic errors is to execute it.  A given SF can contain data and edit commands, as well as direct commands.

SF’s can call other SF’s, that in turn can call other SF’s up to ten levels.  When an SF calls another SF control immediately passes to the next level SF.  When the next level SF runs to completion, it then returns control to the line following that, which called it in the first SF. However, a USE NO SF command in any SF terminates execution of all SF’s.

Within an SF, the USE DBL command causes the current DBL to close, and all further lines in the System File can operate only on command not requiring a DBL.  A later USE DBL command could return processing to the first DBL, or could pass to a third DBL.

The command TERMINAL can be included in an SF to allow a command to be entered interactively during SF execution.  There is no limit to the number of TERMINAL commands that can be included in an SF and they can follow one another.  The SF cannot control the execution of the line entered.  If terminal input is erroneous, ACCENT R does not permit reentry, but continues processing with the next SF line.

When a System File is executed, any lines that ACCENT R would normally display on the terminal are displayed, but the lines of the System File are not themselves displayed unless ENABLE SF TRACE is in effect.

Example

The following example shows a System File (SF) that declares a Data Set (DS), then counts the records in it.  The SF is invoked with TRACE disabled (the default), then with TRACE enabled.

*LIST SF CHCK
USE DS SALES_DBM2
COUNT
*USE SF CHCK
21 RECORDS
*ENABLE SF TRACE
*USE SF CHCK
<<SF USE DS SALES_DBM2
<<SF COUNT
21 RECORDS

NOTES:  When an SF is executing, ACCENT R displays any error or warning message that would have occurred if the error had been entered interactively.  The SF aborts if an error occurs in a command. The command DISABLE ERROR ABORT can be used to force continued execution regardless of command errors.

Control of Commands and Data Input from System Files

Command Modules (CM) take precedence over System Files (SF) by default.  When a CM invokes an SF, the SF is accessible but control remains in the CM.  When a CM is invoked from an SF, control immediately passes to the CM.  If the CM contains no ACCEPT statements, it runs to completion and returns control to the line following that, which invoked it in the SF.  The command ENABLE SF COMMAND INPUT in a CM passes control to any open SF.  Commands are then taken from the SF until the command DISABLE SF COMMAND INPUT is encountered.

Both CM’s and Process Modules (PM) can take data input from an SF.  If a CM or PM contains an ACCEPT statement, by default, it goes to the SF for input.  Only when there are no more lines in the SF does the CM or PM go to the terminal for input.  The statements ENABLE SF DATA INPUT (the default) and DISABLE SF DATA INPUT are allowed in both PM’s and CM’s.  These two statements control whether data for an ACCEPT statement comes from an SF or the terminal.  In the default state, if any SF is declared, input will be taken from the SF.  DISABLE SF DATA INPUT is used to override the default state and allow data to come from the terminal.  DISABLE does not close the SF, and, if an ENABLE SF DATA INPUT statement subsequently is executed, the PM or CM will return to the SF and take data from the next line of that file. 

DISABLE SF DATA INPUT can also be used in a SF.

Applications of System Files for Command Control

Environmental initialization and start up procedures are two common uses of System Files as command files. System Files can be used automatically to both start and end an ACCENT R session.

STARTUP Files

A startup file can be designed to save and automatically execute the routine commands that begin an ACCENT R session, or to control the whole terminal session.  They are particularly useful when a person using an application is not the same person who programmed it.

When ACCENT R is called, it looks for a file named BEGIN.ACC.  If such a file exists, commands are taken from the BEGIN file rather than from the terminal.  The startup file could control the whole terminal session by calling a CM or PM that gives the user options, performs certain tasks, and then passes control to another SF, which could contain the QUIT command (QUIT.ACC).  By default, once a BEGIN file starts executing, control is not returned to the terminal until the BEGIN file, and any PM’s, CM’s, or other SF’s called by it, have run to completion.

Both BEGIN.ACC and QUIT.ACC with their various forms are discussed next.

ACCENT R supports the execution of up to three startup command files.  It is possible for all three command files to be executed.

  1. NIS:BEGIN.ACC (system-wide) can be used to set Equated Commands, set a system-wide default editor, etc.  This will permit the System Manager to control access to ACCENT R.
  2. BEGIN.ACC (log-in directory) will permit the user to have a central startup command file.
  3. BEGIN.ACC (connected directory) allows the use of a locally specific startup command file.

ACCENT R supports the execution of up to three terminating or exiting command files.  It is possible for all three command files to be executed.

  1. QUIT.ACC (connected directory) allows the use of a locally specific exit command file.
  2. QUIT.ACC (log-in directory) will permit the user to have a central exiting command file.
  3. NIS:QUIT.ACC (system-wide) will permit the System Administrator to control the exit of ACCENT R.

Example

A startup file that would take the user directly from entering ACCENT R at the terminal to the first question in the CM follows:
*LIST SF BEGIN.ACC
USE DBL BIZNIS
TYPE "GOOD MORNING!"
TYPE "IT’S ",@CTIME," ON ",@CDATE
TYPE "LET’S GET STARTED."
USE CM PRICE

The beginning of an ACCENT R session with this BEGIN file in effect is shown below.

@ACCENT
GOOD MORNING!
IT’S 08:08 ON 11/11/85
LET’S GET STARTED

The PRICE program’s screen/menu would appear.

NOTES:  Command files are not needed to start or end an ACCENT R session.  Of the command files listed, any one, two or all three of each type (BEGIN/QUIT.ACC) may be used.  The order of execution in using multiple command files is set at each site by the System Manager.  Refer to the ACCENT R OpenVMS Installation Guide for specifying the execution order.  The default order is system level, then login, then connected directory.

ACCENT R provides a second type of startup file for use when transferring control to ACCENT R from a running program.  When a program transfers control to ACCENT R by executing a LINK statement, it can take commands either from a BEGIN.ACC file or from a file named ###ACC.TMP.  The procedure for using a TMP file assumes that the TMP file is itself written by the program each time it executes, and so will be used only once.

DIGITAL COMMAND LANGUAGE

ACCENT R can be invoked from a Digital Command Language (DCL) command file without any special considerations under normal conditions.  However, when the BEGIN.ACC for start-up executes a Process Module (PM) or Command Module (CM) which makes use of ACCENT R’s window development language, SMF (Screen Management Facility), or requires input from the user, the application will not start correctly.  With SMF applications, the SMF-based FILL or MENU screen will send bells to the terminal and flash the cursor.  This is due to a limitation in the OpenVMS SMG Library.  For CM’s or PM’s that require terminal input, the error message "%RMS-E-EOF, end of file detected" is displayed at the first place where user input is expected.

In order to start the application correctly,; the DCL command procedure must first reassign the process logical for command input with the following DCL command:

$ ASSIGN/USER/NOLOG SYS$COMMAND    SYS$INPUT

This logical name is temporary and will be reassigned automatically by DCL.

Example

The contents of a command procedure in a .COM file might be the following:

$ !
$ ! USER.COM
$ !
$ SET DEFAULT SYS$SYSDEVICE:[NAME]
$ ASSIGN/USER/NOLOG SYS$COMMAND SYS$INPUT
$ ACCENT
$ SET DEFAULT SYS$LOGIN
The contents of BEGIN.ACC in the user’s directory:
! User's BEGIN.ACC file
!
TYPE @VERSION@''
SET 'EDIT/EDT' TO @EDITOR
USE DBL USER_LIB
USE DS NISDATA:BOOKS
USE PM BOOKS_MAIN_MENU
QUIT

Generating Commands from User Input

A short System File (SF) can often be used to allow a choice from a menu of several routine tasks.

Example

The following example uses Dynamic Command Modification to construct a command.  The Data Base Library (DBL) in this case already contains three reporting Process Modules (PM), WEEKLY, MONTHLY, and QUARTERLY.  The DISABLE statement directs ACCENT R to accept input from the terminal, not the SF. If the DISABLE statement were not there, ACCENT R would continue to read the SF for the input into @STRING(2).

*LIST SF SALES
DISABLE SF DATA INPUT
TYPE "DO YOU WANT WEEKLY, MONTHLY, OR QUARTERLY SUMMARY?"
ACCEPT @STRING(2)
TYPE "DO YOU WANT THE REPORT SORTED ON DEPT OR STATE?"
ACCEPT @STRING(1)
TYPE "WHAT NAME DO YOU WANT ON YOUR REPORT FILE?"
ACCEPT @STRING(3)
USE DS INVEN
SORT ON $@STRING(1)
REPORT VIA PM $@STRING(2) REPORT 1 TO $@STRING(3)
*USE SF SALES
DO YOU WANT WEEKLY,MONTHLY,OR QUARTERLY SUMMARY?
QUARTERLY
DO YOU WANT THE REPORT SORTED ON DEPT OR STATE?
DEPT
WHAT NAME DO YOU WANT ON YOUR REPORT FILE?
JAN29

Combining Commands and data in one System File

The following example shows a System File (SF) that defines a Schema Definition (SD), creates a Data Set (DS), loads the data for the DS, then calls a second SF, which performs some simple commands.  TYPE commands throughout the SF’s allow the programmer to track progress during execution.

Example

*LIST SF X.DAT
ENABLE SF DATA INPUT
DEFINE SD X
INSERT
FLDA,CHAR,3
FLDB,INT,3
END
SAVE
TYPE "SCHEMA IS FINISHED"
CREATE DS X SD X
TYPE "DATA SET IS CREATED"
USE DS X
ENTER
AAA,333
BBB,999
CCC,111
***
TYPE "DATA IS ENTERED"
USE SF Z.DAT
TYPE "NOW LEAVING ACCENT R"
QUIT
*LIST SF Z.DAT
EXTRACT
TYPE "FIRST EXTRACT COMMAND FINISHED"
SORT ON FLDB
TYPE "SORT FINISHED"
EXTRACT
TYPE "SECOND EXTRACT FINISHED"

The commands in Z.DAT could also have been in X.DAT.

When the System File (SF) X.DAT is executed, it transfers control to Z.DAT.  After Z.DAT runs to completion, it returns control to X.DAT and that file runs to completion. Next, the user reenters ACCENT R and lists the Schema Definition (SD) and Data Set (DS) that were created by the three SF’s.

*USE DBL SFSTUF
*USE SF X.DAT
SCHEMA IS FINISHED
DATA SET IS CREATED
DATA IS ENTERED
AAA 333
BBB 999
CCC 111
FIRST EXTRACT COMMAND FINISHED
SORT FINISHED
CCC 111
AAA 333
BBB 999
SECOND EXTRACT FINISHED
NOW LEAVING ACCENT R
$ACCENT
ACCENT R, OpenVMS Version 11.90 Copyright 1998 by NIS, Inc.
*USE DBL SFSTUF
*LIST SD X
00010  FLDA,C,3
00020  FLDB,I,3
*USE DS X
*EXTRACT
CCC 111
AAA 333
BBB 999

One excellent use of combination SF’s is in submitting change requests or bug reports, since the SF can create the environment, duplicate the symptoms, and then remove the environment.

The following combination SF is based on a bug report submitted to National Information Systems.  The problem caused the SORT command to abort whenever values set to @STRING and @INTEGER were used in the command line.  The SF defines the Data Base Library (DBL) and SD, then creates the DS, and defines the Command Module (CM) necessary to recreate the bug.  It then removes all the ACCENT R objects that were created.  The programmer need only enter ACCENT R and invoke the SF.

*LIST SF PROBLEM
USE NO DBL
REMOVE SF SOLVE.DBL,SOLVE.DS,TEMP.DS
USE SF PROBLM AS LOG
!DEFINITIONS
CREATE DBL SOLVE
DEFINE SD SOLVE
INSERT
LOT_NUMB,INT,3
DATE,FULLDATE
MACHINE,CHAR,10
LOAD_DAYS,INT,2
FINISH_DAYS,INT,2
YARDAGE,FLOAT,10,1
TONS_INPLACE,FLOAT,10,1
TONS_AVAIL,FLOAT,10,1
TONS_SHIPPED,FLOAT,10,1
INVENTORY,FLOAT,10,1,OCCURS 10
NONIDLE_TIME,INT,6
END
SAVE
CREATE DS SOLVE SD SOLVE
CREATE DS TEMP SD SOLVE
DEFINE CM SOLVE
INSERT
CLEAR DS TEMP
SET @DATSTR@CAL "11/1/85" TO @STRING(10)
SET 99 TO @INTEGER
SET @DATSTR@CAL@STRING(10) TO @STRING(10)
USE DS SOLVE
SORT IF LOT_NUMB=@INTEGER & DATE=@CAL@STRING(10) &
MACHINE<>"BUTLER5" ON MACHINE TO TEMP
END
SAVE
! BUILD THESE TWO RECORDS (BUG IS DATA DEPENDENT)
! AND EXECUTE CM
USE DS SOLVE
ENTER NEW
99,11/01/1985,BUTLER 5,**
99,11/01/1985,BUTLER 5,**
***
USE CM SOLVE
USE NO DBL
REMOVE SF SOLVE.DBL,SOLVE.DS,TEMP.DS
USE NO SF LOG