Extract Files

In this section:

Extract files save lines of user input and output during a FOCUS session.

By default, extract files are written to the z/VM minidisk specified by the SET TEMP command. If you do not issue the SET TEMP command, extract files are written to the minidisk with the largest amount of unused space to which you have write access. The name of an extract file is the AS name specified in the command that creates it or, if no AS name is specified, a default name (HOLD, SAVE, or SAVB). The file type is assigned based on the extract file format.

You use a FILEDEF command to assign a file name, file type, and file mode for an extract file.

In the case of a HOLD file, the Master File is not affected by the FILEDEF command. The Master File is written to the minidisk specified by the SET TEMP command, and its name is taken from the AS name in the HOLD command. If the HOLD command does not contain an AS phrase, the Master File name is HOLD.


Top of page

x
Locating Extract Files

How to:

Reference:

As soon as FOCUS is entered, it searches for the disk with the largest available space that you have write access to and will place all work files there. The TEMP DISK parameter may be used to specify a particular disk for the creation of work and extract files. Changing the TEMP DISK will only affect the disk on which new files are created.



Example: Specifying a Location for Extract Files

The following places all extract files on the D disk:

SET TEMP DISK = D


x
Reference: Notes for Using the FILEDEF Command With an Extract File

The following should be considered when using the FILEDEF command:



x
Syntax: How to Issue a FILEDEF Command for Creating an Extract File

Issue the following command before creating the extract file

CMS FILEDEF ddname DISK filename filetype filemode

where:

ddname

Is the AS name from the HOLD, SAVE, or SAVB command. If the command did not specify an AS name, the ddname is HOLD, SAVE, or SAVB.

filename

Is the file name for the extract file.

filetype

Is the file type for the extract file.

filemode

Is the file mode for the extract file. You must have write access to this minidisk. If you do not have write access, the following error message is returned:

(FOC350) ERROR WRITING OUTPUT FILE: filename



Example: Using FILEDEF to Create a HOLD File

In the following examples, SET TEMP = T. The request is:

TABLE FILE EMPLOYEE
PRINT CURR_SAL BY LAST_NAME BY FIRST_NAME
ON TABLE HOLD AS CURRSAL
END

Running this request with no FILEDEF command creates the following files:

CURRSAL  MASTER   T1 
CURRSAL  FOCTEMP  T1 

Issue the following FILEDEF command:

CMS FILEDEF CURRSAL DISK SALLIST DATA A 

Now, running the same request creates the following files:

CURRSAL  MASTER   T1
SALLIST  DATA     A1

Note that the file name, file type, and destination minidisk for the extract file are taken from the FILEDEF command. The file name and destination minidisk for the Master File are not.


Top of page

x
HOLD Files

How to:

A HOLD file is a sequential data source that contains the results of a report request. To save report output in a HOLD file, you must execute the HOLD command.

If you specify the FORMAT FOCUS option with HOLD, FOCUS creates normal MASTER and FOCTEMP files, each with the file name FOC$HOLD, as well as the Master File for the final FOCUS data source. These files are then used as input to the MODIFY that creates the final FOCUS data source . The new FOCUS data source and Master File are created on your temporary disk (that is, the disk specified with the FOCUS command SET TEMP disk).

If you create a FOCUS data source larger than one gigabyte using HOLD FORMAT FOCUS, you will need a very large amount of TEMP space available.



x
Syntax: How to Create a HOLD File
HOLD [AS ddname]

where:

ddname

Is the name of the file that will contain the report output. The default name is HOLD. The fileid used is ddname FOCTEMP unless you specify the format option (see the Creating Reports manual). FOCUS also creates ddname MASTER to contain a Master File that describes the report output.


Top of page

x
SAVB Files

How to:

A SAVB contains the results of a report request with all numeric report fields in binary format. The file cannot be printed. Also, all character fields are padded with spaces to a multiple of 4 bytes.



x
Syntax: How to Create a SAVB File
SAVB [AS ddname]

where:

ddname

Is the name of the file. The default name is SAVB. The fileid is ddname FOCTEMP.


Top of page

x
SAVE Files

How to:

A SAVE file contains the results of a report request with all columns in the report in printable, character format with no spaces between columns.



x
Syntax: How to Create a SAVE File
SAVE [AS ddname]

where:

ddname

Is the name of the file. The default name is SAVE. The fileid is ddname FOCTEMP.


Top of page

x
LOG and Transaction Files

How to:

Reference:

LOG and transaction files contain FOCUS transactions.



x
Syntax: How to Create a LOG File

To log transactions on a file, first define the file with this command

FILEDEF ddname DISK fileid (RECFM recfm LRECL lrecl

where:

ddname

Is the ddname of the file specified by the LOG category ON ddname statement.

fileid

Is the CMS fileid of the file receiving the transactions.

recfm

Is the format of the file (F for fixed, V for variable).

lrecl

Is the file record length. The proper record length is discussed in the Maintaining Databases manual.



Example: Logging Transactions to a LOG File

For example, this request logs transactions in the file EMPTRANS TRANSACT A:

CMS FILEDEF ALLTRANS DISK EMPTRANS TRANSACT A (RECFM F LRECL 24
MODIFY FILE EMPLOYEE
LOG TRANS ON ALLTRANS
PROMPT EMP_ID CURR_SAL
VALIDATE
   SAL_TEST = IF CURR_SAL GT 50000 THEN 0 ELSE 1;
MATCH EMP_ID
   ON MATCH UPDATE CURR_SAL
   ON NOMATCH REJECT
DATA


x
Syntax: How to Create a Transaction File

To have a MODIFY request read a transaction file, define the file to the ddname specified in the FIXFORM, FREEFORM, or DATA statements by entering the CMS command

FILEDEF ddname DISK fileid (LRECL lrecl RECFM recfm BLKSIZE blksize)

where:

ddname

Is the ddname specified in the FIXFORM or DATA statement.

fileid

Is the CMS fileid of the transaction file.

When you create a transaction file to be read by the FIXFORM statement, be sure that it has a fixed-length record format (RECFM F).

You do not need to define the file if the file has a file type of DATA, a file mode of A and the records are 80-byte fixed format.



Example: Reading Records From a Transaction File

For example, this request reads fixed-format records from the file EMPFILE DATA A:

CMS FILEDEF FLOAFILE DISK EMPFILE DATA A
MODIFY FILE EMPLOYEE
COMPUTE FLOATSAL/F8=;
FIXFORM EMP_ID/12 FLOATSAL/F4
COMPUTE CURR_SAL = FLOATSAL;
MATCH EMP_ID
   ON NOMATCH REJECT
   ON MATCH UPDATE CURR_SAL
DATA ON FLOAFILE
END


x
Syntax: How to Send TYPE Messages to a Transaction File

To send MODIFY TYPE messages to a file, first define the file with this CMS command

FILEDEF ddname DISK fileid (RECFM recfm LRECL lrecl

where:

ddname

Is the ddname of the file specified by the TYPE ON ddname statement.

fileid

Is the CMS fileid of the file receiving the messages.

recfm

Is the format of the file (F for fixed, V for variable).

lrecl

Is the file record length.



Example: Sending TYPE Messages to a Transaction File

For example, this request records accepted transactions in the file ACCEPT TRANS A and rejected transactions in the file REJECT TRANS A:

CMS FILEDEF ACCFILE DISK ACCEPT TRANS A (RECFM F LRECL 80
CMS FILEDEF REJFILE DISK REJECT TRANS A (RECFM F LRECL 80
MODIFY FILE EMPLOYEE
PROMPT EMP_ID CURR_SAL
MATCH EMP_ID
   ON MATCH TYPE ON ACCFILE
      "<EMP_ID <12 <CURR_SAL"
   ON MATCH UPDATE CURR_SAL
   ON NOMATCH TYPE ON REJFILE
      "<EMP_ID <12 <CURR_SAL"
   ON NOMATCH REJECT
DATA


x
Reference: Dialogue Manager Input and Output Files

All files used in -READ or -WRITE statements must be explicitly defined.


Information Builders