How to: |
Reference: |
Whether issued within a request or after the request has been executed, the HOLD command can create a FOCUS data source and a corresponding Master File from the data extracted by the report request. This feature enables you to create:
Tip: If you are working in an environment that supports SCAN, FSCAN, MODIFY, or Maintain, and you create a HOLD file in FOCUS format, you can update, as well as report against, the HOLD file. See your documentation on these facilities for details.
Note: Holding a file in FOCUS format may generate the (FOC441) warning: The file exists already. Create will write over it. Issuing the SET WARNING=OFF command suppresses this message.
In a report request, use
ON TABLE HOLD [AS filename] FORMAT FOCUS [INDEX field1 field2 ...]
where:
The name can be up to 64 characters long.
Note: If you use a name longer than eight characters on z/OS, an eight-character member name is generated as described in the Describing Data With TIBCO WebFOCUS® Language manual. To relate the long name to the short member name, the $ VIRT attribute is generated on the top line in the Master File. The resulting HOLD file is a temporary data file. To allocate the long Master File name to a permanent data file, issue the DYNAM ALLOCATE command with the LONGNAME option prior to the HOLD request. The ddname in the command must refer to an existing member of the MASTER data set.
Enables you to index FOCUS fields. All fields specified after INDEX are specified as FIELDTYPE=I in the Master File. Up to four fields can be indexed.
Note: Since the number of index field names is variable, a command name that follows the HOLD command and starts with the same characters as a field name may be counted as another index field, generating an error. For example, if the command following HOLD starts with ON TABLE and a field name starts with the characters 'ON', the ON in the command will be considered a truncated field name to add to the index. To avoid this issue, either set the FIELDNAME parameter to NOTRUNC, so that command names will not be confused with truncated field names, or move the HOLD command to the end of the procedure right before the END command.
Note that once you use this format from Hot Screen, you cannot issue another HOLD command while in the same Hot Screen session.
The HOLD file is dynamically allocated if it is not currently allocated in z/OS. This means the system may delete the file at the end of the session, even if you have not done so. Since HOLD files are usually deleted, this is the desired default. However, if you want to save the Master File, allocate it to ddname HOLDMAST as a permanent data set. The allocation can be performed in the standard FOCUS CLIST. For example:
ALLOC F(HOLDMAST) DA('qualif.HOLDMAST') SHR REUSE
Note that ddname HOLDMAST must not refer to the same data set referred to by the MASTER and FOCEXEC ddnames.
The structure of the FOCUS data source varies according to the report request. The rules are as follows:
To control whether the ACCEPT and TITLE attributes are propagated to the Master File associated with the HOLD file, use the SET HOLDATTR command. To control the FIELDNAME attribute in the Master File of the HOLD file, use the SET ASNAMES command. For more information on how to control the TITLE, ACCEPT, and FIELDNAME attributes in a HOLD Master File, see Controlling Attributes in HOLD Master Files.
The following example creates a subset of the CAR data source.
TABLE FILE CAR SUM SALES BY COUNTRY BY CAR BY MODEL ON TABLE HOLD AS X1 FORMAT FOCUS END
This request creates a single-segment FOCUS data source with a SEGTYPE of S3 (because it has three BY fields) named X1.
The X1 Master File is created by the request:
FILE=X1, SUFFIX=FOC SEGMENT=SEG01 ,SEGTYPE=S03 FIELDNAME=COUNTRY ,ALIAS=E01 ,USAGE=A10 ,$ FIELDNAME=CAR ,ALIAS=E02 ,USAGE=A16 ,$ FIELDNAME=MODEL ,ALIAS=E03 ,USAGE=A24 ,$ FIELDNAME=SALES ,ALIAS=E04 ,USAGE=I6 ,$
This example creates a single-segment FOCUS data source with a SEGTYPE of S4 because of the three BY fields and the FOCLIST FIELD.
TABLE FILE CAR PRINT SALES BY COUNTRY BY CAR BY MODEL ON TABLE HOLD AS X2 FORMAT FOCUS INDEX MODEL END
The Master File created by this request is:
FILE=X2, SUFFIX=FOC SEGMENT=SEG01, SEGTYPE=S04 FIELDNAME=COUNTRY ,ALIAS=E01 ,USAGE=A10 ,$ FIELDNAME=CAR ,ALIAS=E02 ,USAGE=A16 ,$ FIELDNAME=MODEL ,ALIAS=E03 ,USAGE=A24 ,FIELDTYPE=I,$ FIELDNAME=FOCLIST ,ALIAS=E04 ,USAGE=I5 ,$ FIELDNAME=SALES ,ALIAS=E05 ,USAGE=I6 ,$
The following request contains two SUM commands. The first, SUM SALES BY COUNTRY, creates a segment with COUNTRY as the key and the summed values of SALES as a data field. The second, SUM SALES BY COUNTRY BY CAR BY MODEL, creates a descendant segment, with CAR and MODEL as the keys and SALES as a non-key field.
The COUNTRY field does not form part of the key to the second segment. COUNTRY is a key in the path to the second segment. Any repetition of this value is redundant.
TABLE FILE CAR SUM SALES BY COUNTRY SUM SALES BY COUNTRY BY CAR BY MODEL ON TABLE HOLD AS X3 FORMAT FOCUS END
This creates a two-segment FOCUS data source:
The Master File for this newly-created FOCUS data source is:
FILE=X3, SUFFIX=FOC SEGMENT=SEG01, SEGTYPE=S01 FIELDNAME=COUNTRY ,ALIAS=E01 ,USAGE=A10 ,$ FIELDNAME=SALES ,ALIAS=E02 ,USAGE=I6 ,$ SEGMENT=SEG02, SEGTYPE=S02,PARENT=SEG01 FIELDNAME=CAR ,ALIAS=E03 ,USAGE=A16 ,$ FIELDNAME=MODEL ,ALIAS=E04 ,USAGE=A24 ,$ FIELDNAME=SALES ,ALIAS=E05 ,USAGE=I6 ,$
In this example, each display command creates one segment.
The key to the root segment is the BY field, COUNTRY, while the keys to the descendant segments are the new BY fields. The last segment uses the internal FOCLIST field as part of the key, since the display command is PRINT.
TABLE FILE CAR SUM SALES BY COUNTRY BY CAR SUM SALES BY COUNTRY BY CAR BY MODEL PRINT SALES BY COUNTRY BY CAR BY MODEL BY BODY ON TABLE HOLD AS X4 FORMAT FOCUS INDEX COUNTRY MODEL END
The Master File is:
FILE=X4, SUFFIX=FOC SEGMENT=SEG01, SEGTYPE =S02 FIELDNAME=COUNTRY ,ALIAS=E01 ,USAGE=A10 ,FIELDTYPE=I,$ FIELDNAME=CAR ,ALIAS=E02 ,USAGE=A16 ,$ FIELDNAME=SALES ,ALIAS=E03 ,USAGE=I6 ,$ SEGMENT=SEG02, SEGTYPE =S01 ,PARENT=SEG01 FIELDNAME=MODEL ,ALIAS=E04 ,USAGE=A24 ,FIELDTYPE=I,$ FIELDNAME=SALES ,ALIAS=E05 ,USAGE=I6 ,$ SEGMENT=SEG03, SEGTYPE =S02 ,PARENT=SEG02 FIELDNAME=BODYTYPE ,ALIAS=E06 ,USAGE=A12 ,$ FIELDNAME=FOCLIST ,ALIAS=E07 ,USAGE=I5 ,$ FIELDNAME=SALES ,ALIAS=E08 ,USAGE=I6 ,$