In this section: |
The commands SET ASNAMES, SET HOLDLIST, and SET HOLDATTR enable you to control the FIELDNAME, TITLE, and ACCEPT attributes in HOLD Master Files. These commands are issued prior to the report request and remain in effect for the duration of the session, unless you change them.
In addition, the SET HOLDSTAT command enables you to include comments and DBA information in the HOLD Master File. For more information about SET HOLDSTAT, see the Describing Data manual. For details about SET commands, see the Developing Applications manual.
How to: Reference: |
When SET ASNAMES is set to ON or FOCUS, the literal specified in an AS phrase in a report request is used as the field name in a HOLD Master File. This command also controls how ACROSS fields are named in HOLD files.
SET ASNAMES = [ON|OFF|FOCUS]
where:
Uses the literal specified in an AS phrase for the field name and controls the way ACROSS fields are named in HOLD files of any format.
Does not use the literal specified in an AS phrase as a field name in HOLD files, and does not affect the way ACROSS fields are named.
Uses the literal specified in an AS phrase as the field name and controls the way ACROSS fields are named only in HOLD files in FOCUS format. FOCUS is the default value.
PRINT COUNTRY AS 'PLACE,OF,ORIGIN'
produces the field name PLACE in the HOLD Master File.
If an AS phrase is used for the fields in the ACROSS phrase, each new column has a field name composed of the literal in the AS phrase concatenated to the beginning of the value of the first field used in the ACROSS phrase.
In the following example, SET ASNAMES=ON causes the text in the AS phrase to be used as field names in the HOLD1 Master File. The two fields in the HOLD1 Master File, NATION and AUTOMOBILE, contain the data for COUNTRY and CAR.
SET ASNAMES=ON TABLE FILE CAR PRINT CAR AS 'AUTOMOBILE' BY COUNTRY AS 'NATION' ON TABLE HOLD AS HOLD1 END
The request produces the following Master File:
FILE=HOLD1, SUFFIX=FIX SEGMENT=HOLD1, SEGTYPE=S01,$ FIELDNAME=NATION ,ALIAS=E01 ,USAGE=A10 ,ACTUAL=A12 ,$ FIELDNAME=AUTOMOBILE ,ALIAS=E02 ,USAGE=A16 ,ACTUAL=A16 ,$
The following request generates a HOLD Master File with one unique field name for SALES and one for AVE.SALES. Both SALES and AVE.SALES would be named SALES, if SET ASNAMES had not been used.
SET ASNAMES=ON TABLE FILE CAR SUM SALES AND AVE.SALES AS 'AVERAGESALES' BY CAR ON TABLE HOLD AS HOLD2 END
The request produces the following Master File:
FILE=HOLD2, SUFFIX=FIX SEGMENT=HOLD2, SEGTYPE=S01,$ FIELDNAME=CAR ,ALIAS=E01 ,USAGE=A16 ,ACTUAL=A16 ,$ FIELDNAME=SALES ,ALIAS=E02 ,USAGE=I6 ,ACTUAL=I04 ,$ FIELDNAME=AVERAGESALES ,ALIAS=E03 ,USAGE=I6 ,ACTUAL=I04 ,$
The following request produces a HOLD Master File with the literal CASH concatenated to each value of COUNTRY.
SET ASNAMES=ON TABLE FILE CAR SUM SALES AS 'CASH' ACROSS COUNTRY ON TABLE HOLD AS HOLD3 END
The request produces the following Master File:
FILE=HOLD3, SUFFIX=FIX SEGMENT=HOLD3, SEGTYPE=S01,$ FIELDNAME=CASHENGLAND ,ALIAS=E01 ,USAGE=I6 ,ACTUAL=I04 ,$ FIELDNAME=CASHFRANCE ,ALIAS=E02 ,USAGE=I6 ,ACTUAL=I04 ,$ FIELDNAME=CASHITALY ,ALIAS=E03 ,USAGE=I6 ,ACTUAL=I04 ,$ FIELDNAME=CASHJAPAN ,ALIAS=E04 ,USAGE=I6 ,ACTUAL=I04 ,$ FIELDNAME=CASHW GERMANY ,ALIAS=E05 ,USAGE=I6 ,ACTUAL=I04 ,$
Without the SET ASNAMES command, every field in the HOLD FILE is named COUNTRY.
To generate field names for ACROSS values that include only the field value, use the AS phrase followed by two single quotation marks, as follows:
SET ASNAMES=ON TABLE FILE CAR SUM SALES AS '' ACROSS COUNTRY ON TABLE HOLD AS HOLD4 END
The resulting Master File looks like this:
FILE=HOLD4, SUFFIX=FIX SEGMENT=HOLD4, SEGTYPE=S0,$ FIELDNAME=ENGLAND ,ALIAS=E01 ,USAGE=I6 ,ACTUAL=I04 ,$ FIELDNAME=FRANCE ,ALIAS=E02 ,USAGE=I6 ,ACTUALI04 ,$ FIELDNAME=ITALY ,ALIAS=E03 ,USAGE=I6 ,ACTUALI04 ,$ FIELDNAME=JAPAN ,ALIAS=E04 ,USAGE=I6 ,ACTUALI04 ,$ FIELDNAME=W GERMANY ,ALIAS=E05 ,USAGE=I6 ,ACTUALI04 ,$
How to: |
You can use the SET HOLDLIST command to restrict fields in HOLD Master Files to those appearing in a request.
SET HOLDLIST = {PRINTONLY|ALL|ALLKEYS}
where:
Specifies that only those fields that would appear in the report are included in the generated HOLD file. Non-displaying fields in a request (those designated as NOPRINT fields) are not included in the HOLD file.
Specifies that all display fields referenced in a request appear in a HOLD file, including calculated values. ALL is the default value. OLD may be used as a synonym for ALL.
Note: Vertical sort (BY) fields specified in the request with the NOPRINT option are not included in the HOLD file even if HOLDLIST=ALL.
Propagates all fields, including NOPRINTed BY fields.
Note that SET HOLDLIST may also be issued from within a TABLE request. When used with MATCH, SET HOLDLIST always behaves as if HOLDLIST is set to ALL.
When HOLDLIST is set to ALL, the following TABLE request produces a HOLD file containing all specified fields, including NOPRINT fields and values calculated with the COMPUTE command.
SET HOLDLIST=ALL TABLE FILE CAR PRINT CAR MODEL NOPRINT COMPUTE TEMPSEATS=SEATS+1; BY COUNTRY ON TABLE HOLD END ? HOLD
The output is:
NUMBER OF RECORDS IN TABLE= 18 | LINE= | 18 | ||
DEFINITION OF HOLD FILE: HOLD | ||||
FIELDNAME | ALIAS | FORMAT | ||
COUNTRY | E01 | A10 | ||
CAR | E02 | A16 | ||
MODEL | E03 | A24 | ||
SEATS | E04 | I3 | ||
TEMPSEATS | E05 | D12.2 |
When HOLDLIST is set to PRINTONLY, the following TABLE request produces a HOLD file containing only fields that would appear in report output:
SET HOLDLIST=PRINTONLY TABLE FILE CAR PRINT CAR MODEL NOPRINT COMPUTE TEMPSEATS=SEATS+1; BY COUNTRY ON TABLE HOLD END ? HOLD
The output is:
NUMBER OF RECORDS IN TABLE= 18 | LINES= | 18 | ||
DEFINITION OF HOLD FILE: HOLD | ||||
FIELDNAME | ALIAS | FORMAT | ||
COUNTRY | E01 | A10 | ||
CAR | E02 | A16 | ||
TEMPSEATS | E03 | D12.2 |
How to: |
The SET HOLDATTR command controls whether the TITLE and ACCEPT attributes in the original Master File are propagated to the HOLD Master File. SET HOLDATTR does not affect the way fields are named in the HOLD Master File.
Note that if a field in a data source does not have the TITLE attribute specified in the Master File, but there is an AS phrase specified for the field in a report request, the corresponding field in the HOLD file is named according to the AS phrase.
SET HOLDATTR =[ON|OFF|FOCUS]
where:
Uses the TITLE attribute as specified in the original Master File in HOLD files in any format. The ACCEPT attribute is propagated to the HOLD Master File only for HOLD files in FOCUS format.
Does not use the TITLE or ACCEPT attributes from the original Master File in the HOLD Master File.
Uses the TITLE and ACCEPT attributes only for HOLD files in FOCUS format. FOCUS is the default value.
In this example, the Master File for the CAR data source specifies TITLE and ACCEPT attributes:
FILENAME=CAR2, SUFFIX=FOC SEGNAME=ORIGIN, SEGTYPE=S1 FIELDNAME =COUNTRY, COUNTRY, A10, TITLE='COUNTRY OF ORIGIN', ACCEPT='CANADA' OR 'ENGLAND' OR 'FRANCE' OR 'ITALY' OR 'JAPAN' OR 'W GERMANY', FIELDTYPE=I,$ SEGNAME=COMP, SEGTYPE=S1, PARENT=ORIGIN FIELDNAME=CAR, CARS, A16, TITLE='NAME OF CAR',$ . . .
Using SET HOLDATTR=FOCUS, the following request
SET HOLDATTR = FOCUS TABLE FILE CAR2 PRINT CAR BY COUNTRY ON TABLE HOLD FORMAT FOCUS AS HOLD5 END
produces this HOLD Master File:
FILE=HOLD5, SUFFIX=FOC SEGMENT=SEG01, SEGTYPE=S02 FIELDNAME=COUNTRY ,USAGE=E01 ,ACTUAL=A10 TITLE='COUNTRY OF ORIGIN', ACCEPT=CANADA ENGLAND FRANCE ITALY JAPAN 'W GERMANY',$ FIELDNAME=FOCLIST ,USAGE=E02 ,ACTUAL=I5 ,$ FIELDNAME=CAR ,USAGE=E03 ,ACTUAL=A16 , TITLE='NAME OF CAR' ,$
Information Builders |