The Displayed Data Type: USAGE

In this section:

 

This attribute, which is also known as FORMAT, describes how to format a field when displaying it in a report or using it in a calculation.


Top of page

x
Specifying a Display Format

How to:

Reference:

For FOCUS data sources, which do not use the ACTUAL attribute, USAGE also specifies how to store the field. For other types of data sources, assign a USAGE value that corresponds to the ACTUAL value, to identify the field as the same data type used to store it in the data source. If the data is store as alphanumeric, assign the USAGE based on how the field will be displayed in your reports. The conversion is done automatically. For instructions on which ACTUAL values correspond to which USAGE values, see the documentation for the specific data adapter. For sequential, VSAM, and ISAM data sources, see Describing a Sequential, VSAM, or ISAM Data Source. For other types of data sources, see your adapter documentation.

In addition to selecting the data type and length, you can also specify display options, such as date formatting, floating dollar signs, and zero suppression. Use these options to customize how the field appears in reports.



x
Syntax: How to Specify a Display Format
USAGE = tl[d]

where:

t

Is the data type. Valid values are A (alphanumeric), F (floating-point single-precision), D (floating-point double-precision), I (integer), P (packed decimal), D, W, M, Q, or Y used in a valid combination (date), and TX (text).

l

Is a length specification. The specification varies according to the data type. See the section for each data type for more information. Note that you do not specify a length for date format fields.

d

Is one or more display options. Different data types offer different display options. See the section for each data type for more information.

The complete USAGE value cannot exceed eight characters.

The values that you specify for type and field length determine the number of print positions allocated for displaying or storing the field. Display options only affect displayed or printed fields. They are not active for non-display retrievals, such as extract files.

Note: If a numeric field cannot display with the USAGE format given (for example, the result of aggregation is too large), asterisks appear.

See the sections for each format type for examples and additional information.



x
Reference: Usage Notes for USAGE

Note the following rules when using USAGE:


Top of page

x
Data Type Formats

You can specify several types of formats:


Top of page

x
Integer Format

You can use integer format for whole numbers. An integer is any value composed of the digits zero to nine, without a decimal point.

You can also use integer fields with date display options to provide limited date support. This use of integer fields is described in the Alphanumeric and Numeric Formats With Date Display Options.

The integer USAGE type is I. See Numeric Display Options. The format of the length specification is:

n

where:

n

Is the number of digits to display. The maximum length is 11, which must include the digits and a leading minus sign if the field contains a negative value. You can also specify a number of decimal places (up to n - 1), and the number will display with a decimal point before that number of digits.

For example:

Format

Display

I6
  4316
I6.2
 43.16
I2
22
I4
 -617


x
Floating-Point Double-Precision Format

You can use floating-point double-precision format for any value composed of the digits zero to nine and an optional decimal point.

The floating-point double-precision USAGE type is D. See Numeric Display Options for the compatible display options. The length specification format is:

t[.s]

where:

t

Is the number of characters to display up to a maximum of 33, including the numeric digits, an optional decimal point, and a leading minus sign if the field contains a negative value. The number of significant digits supported varies with the operating environment.

s

Is the number of digits that follow the decimal point. It can be a maximum of 31 and must be less than t.

For example:

Format

Display

D8.2
3,187.54
D8
416

In the case of D8.2, the 8 represents the maximum number of places, including the decimal point and decimal places. The 2 represents how many of these eight places are decimal places. The commas are automatically included in the display, and are not counted in the total.



x
Floating-Point Single-Precision Format

You can use floating-point single-precision format for any number, including numbers with decimal positions. The number is composed of the digits 0 to 9, including an optional decimal point. This format is intended for use with smaller decimal numbers. Unlike floating-point double-precision format, its length cannot exceed nine positions.

The floating-point single-precision USAGE type is F. Compatible display options are described in Numeric Display Options. The length specification format is:

t[.s]

where:

t

Is the number of characters to display, up to a maximum of 33, including the numeric digits, an optional decimal point, and a leading minus sign if the field contains a negative value. The number of significant digits supported varies with the operating environment.

s

Is the number of digits that follow the decimal point. It can be up to 31 digits and must be less than t.

For example:

Format

Display

F5.1
614.2
F4
318


x
Packed-Decimal Format

You can use packed-decimal format for any number, including decimal numbers. A decimal number is any value composed of the digits zero to nine, including an optional decimal point.

You can also use packed-decimal fields with date display options to provide limited date support. See Alphanumeric and Numeric Formats With Date Display Options.

The packed-decimal USAGE type is P. The compatible display options are described in Numeric Display Options.

The length specification format is:

t[.s]

where:

t

Is the number of characters to display, up to 33, including a maximum of 31 digits, an optional decimal point, and a leading minus sign if the field contains a negative value.

s

Is the number of digits that follow the decimal point. It can be up to 31 digits and must be less than t.

For example:

Format

Display

P9.3
4168.368
P7
617542


x
Numeric Display Options

Display options may be used to edit numeric formats. These options only affect how the data in the field is printed or appears on the screen, not how it is stored in your data source.

Edit Option

Meaning

Effect

-

Minus sign

Displays a minus sign to the right of negative numeric data.

Note: Not supported with format options B, E, R, T, DMY, MDY, and YMD.

%

Percent sign

Displays a percent sign, along with numeric data. Does not calculate the percent.

A

Negative suppression

Displays the absolute value of the number, but does not affect the stored value.

  • If you propagate a field with a negative suppression USAGE attribute to a HOLD file, the HOLD file contains the signed values. The negative suppression USAGE attribute is also propagated to the HOLD file so that if you run a report request against the HOLD file, the minus signs are suppressed on the report output.
  • The negative suppression option cannot be used in with the following display options:
    • B (bracket negative).
    • R (credit negative).
    • - (right side negative).
B

Bracket negative

Encloses negative numbers in parentheses.

c

Comma suppress

Suppresses the display of commas.

Used with numeric format options M and N (floating and non-floating dollar sign) and data format D (floating-point double-precision).

C

Comma edit

Inserts a comma after every third significant digit, or a period instead of a comma if continental decimal notation is in use.

DMY

Day-Month-Year

Displays alphanumeric or integer data as a date in the form day/month/year.

E

Scientific notation

Displays only significant digits.

L

Leading zeroes

Adds leading zeroes.

M

Floating currency symbol ($ for US code page)

Places a floating currency symbol to the left of the highest significant digit. The default currency symbol depends on the code page. You can use the SET CURRSYMB=symbol command to specify any character as the currency symbol or one of the following currency codes:

USD or '$' specifies U. S. dollars.

GBP specifies the British pound.

JPY specifies the Japanese yen or Chinese yuan.

EUR specifies the Euro.

MDY

Month-Day-Year

Displays alphanumeric or integer data as a date in the form month/day/year.

N

Fixed currency symbol ($ for US code page)

Places a currency symbol to the left of the field. The symbol appears only on the first detail line of each page. The default currency symbol depends on the code page. You can use the SET CURRSYMB=symbol command to specify any character as the currency symbol or one of the following currency codes:

USD or '$' specifies U. S. dollars.

GBP specifies the British pound.

JPY specifies the Japanese yen or Chinese yuan.

EUR specifies the Euro.

R

Credit (CR) negative

Places CR after negative numbers.

S

Zero suppress

If the data value is zero, prints a blank in its place.

T

Month translation

Displays the month as a three-character abbreviation.

YMD

Year-Month-Day

Displays alphanumeric or integer data as a date in the form year/month/day.



Example: Using Numeric Display Options

The following table shows examples of the display options that are available for numeric fields.

Option

Format

Data

Display

Minus sign

I2-
D7-
F7.2-
-21
-6148
-8878
21-
6148-
8878.00-

Percent sign

I2%
D7%
F3.2%
21
6148
48
21%
6,148%
48.00%

Comma suppression

D6c
D7Mc
D7Nc
41376
6148
6148
41376
$6148
$  6148

Comma inclusion

I6C
41376
41,376

Zero suppression

D6S
0
 

Bracket negative

I6B
-64187
(64187)

Credit negative

I8R
-3167
3167 CR

Leading zeroes

F4L
31
0031

Floating dollar

D7M
6148
$6,148

Non-floating dollar

D7N
5432
$    5,432

Scientific notation

D12.5E
1234.5
0.12345D+04

Year/month/day

I6YMD
I8YYMD
980421
19980421
98/04/21
1998/04/21

Month/day/year

I6MDY
I8MDYY
042198
04211998
04/21/98
04/21/1998

Day/month/year

I6DMY
I8DMYY
210498
21041998
21/04/98
21/04/1998

Month translation

I2MT
07
JUL

Several display options can be combined, as shown:

Format

Data

Display

I5CB
-61874
(61,874)

All of the options may be specified in any order. Options M and N (floating and non-floating dollar sign) and data format D (floating-point double-precision) automatically invoke option C (comma). Options L and S cannot be used together. Option T (Translate) can be included anywhere in an alphanumeric or integer USAGE specification that includes the M (month) display option. Date display options (D, M, T, and Y), which cannot be used with floating-point fields, are described in Alphanumeric and Numeric Formats With Date Display Options.


Top of page

x
Extended Currency Symbol Display Options

How to:

Reference:

You can select a currency symbol for display in report output regardless of the default currency symbol configured for National Language Support (NLS). Use the extended currency symbol format in place of the floating dollar (M) or non-floating dollar (N) display option. When you use the floating dollar (M) or non-floating dollar (N) display option, the currency symbol associated with the default code page is displayed. For example, when you use an American English code page, the dollar sign is displayed.

The extended currency symbol format allows you to display a symbol other than the dollar sign. For example, you can display the symbol for a United States dollar, a British pound, a Japanese yen or Chinese yuan, or the euro. Extended currency symbol support is available for numeric formats (I, D, F, and P). In Developer Studio, you select these formats in the Formats dialog box.

The extended currency symbol formats are specified as two-character combinations in the last positions of any numeric display format. The first character in the combination can be either an exclamation point (!) or a colon (:). The colon is the recommended character because it will work in all ASCII and EBCDIC code pages. The exclamation point is not consistent on all EBCDIC code pages and may produce unexpected behavior if the code page you are using translates the exclamation point differently. The following table lists the supported extended currency display options:

Display Option

Description

Example

:d or !d

Fixed dollar sign.

D12.2:d

:D or !D

Floating dollar sign.

D12.2:D

:e or !e

Fixed euro symbol.

F9.2:e

:E or !E

Floating euro symbol on the left side.

F9.2:E

:F or !F

Floating euro symbol on the right side.

F9.2:F

:l or !l

Fixed British pound sign.

D12.1:l

:L or !L

Floating British pound sign.

D12.1:L

:y or !y

Fixed Japanese yen or Chinese yuan symbol.

I9:y

:Y or !Y

Floating Japanese yen or Chinese yuan symbol.

I9:Y



x
Reference: Extended Currency Symbol Formats

The following guidelines apply:



x
Syntax: How to Select an Extended Currency Symbol
numeric_format {:|!}option

where:

numeric_format

Is a valid numeric format (data type I, D, F, or P).

: or !

Is required. The exclamation point is not consistent on all EBCDIC code pages and may produce unexpected behavior if the code page you are using translates the exclamation point differently. The colon does not vary across code pages, so it is the recommended symbol to use.

option

Determines the currency symbol that is displayed, and whether the symbol is floating or non-floating. Possible values are:

d displays a non-floating dollar sign.

D displays a floating dollar sign.

e displays a non-floating euro symbol.

E displays a floating euro symbol on the left side.

F displays a floating euro symbol on the right side.

l displays a non-floating British pound sterling symbol.

L displays a floating British pound sterling symbol.

y displays a non-floating Japanese yen or Chinese yuan symbol.

Y displays a floating Japanese yen or Chinese yuan symbol.

The extended currency option must be in the last positions in the format.



Example: Displaying Extended Currency Symbols

The following request displays the euro symbol.

SET PAGE-NUM = OFF
TABLE FILE CENTORD
PRINT PRODNAME QUANTITY PRICE/D10.2!E
BY ORDER_DATE
WHERE QUANTITY GT 700;
ON TABLE SET STYLE *
TYPE = REPORT, GRID = OFF,$
ENDSTYLE
END

The output is:



x
Procedure: How to Display an Extended Currency Symbol
  1. Do one of the following to open the Format dialog box:
    • Click the Format button in the Compute, Define, or Recap dialog box.

    or

    • Right-click a selected field in the Report Painter window and select Format from the menu.

    The Format dialog box opens.

  2. Highlight an extended currency option in the Edit Options list and click OK. The currency option will display when you run the report.


Example: Displaying an Extended Currency Symbol

The following example adds a floating euro symbol to a field.

  1. Create a new procedure, using CENTORD as the data source.
  2. In the Report Painter's main window, add the following fields to your report:
    • DATE
    • PRODNAME
    • QUANTITY
    • PRICE
  3. Select the DATE field, and click By.
  4. Click Where/If. The Report Options window opens.
  5. Enter QUANTITY GT 700, and click OK.
  6. Right-click the PRICE field, and select Format... from the pop-up menu. The Format dialog box opens.
  7. Select Floating Euro symbol - !E from the Edit Options scroll list.
  8. Click OK.

When the report is run, a euro symbol will appear directly to the left of the values in the PRICE field:


Top of page

x
Rounding

When a value with decimal places is assigned to a numeric field, if there are more decimal places in the value than are specified in the field length description, the value is rounded to an acceptable size before either storing or displaying it. The value is rounded down when the first extra decimal digit is less than five, and rounded up when it is five or greater (although an additional consideration is introduced for floating-point values).

For example, consider a packed-decimal field with two decimal places

FIELDNAME = PRESSURE, FORMAT = P8.2, $

to which you assign a value with four decimal places:

PRESSURE = 746.1289

The first extra digit (that is, the first one past the specified length of two decimal places), is 8. Since 8 is greater than or equal to five, the value is rounded up, and PRESSURE becomes:

746.13

The details of rounding are handled in the following ways for the following numeric formats:


Top of page

x
Alphanumeric Format

Reference:

You can use alphanumeric format for any value to be interpreted as a sequence of characters and composed of any combination of digits, letters, and other characters.

You can also use alphanumeric fields with date display options to provide limited date support. This use of alphanumeric fields is described in Alphanumeric and Numeric Formats With Date Display Options.

The alphanumeric USAGE type is A. The format of the length specification is n, where n is the maximum number of characters in the field. You can have up to 3968 bytes in an alphanumeric field in a FOCUS file segment, and up to 4096 bytes in an XFOCUS file segment. You can have up to 4095 bytes in a fixed-format sequential data source. You may define the length in the Master File, a DEFINE FILE command, or a COMPUTE command.

For example:

Format

Display

A522
The minutes of today's meeting were submitted...
A2
B3
A24
127-A429-BYQ-49

Standard numeric display options are not available for the alphanumeric data format. However, alphanumeric data can be printed under the control of a pattern that is supplied at run time. For instance, if you are displaying a product code in parts, with each part separated by a "-", include the following in a DEFINE command:

PRODCODE/A11 = EDIT (fieldname,'999-999-999') ;

where:

fieldname

Is the existing field name, not the newly defined field name.

If the value is 716431014, the PRODCODE appears as 716-431-014. See the Creating Reports With WebFOCUS Language manual for more information.



x
Reference: Usage Notes for 4K Alphanumeric Fields

Top of page

x
Date Formats

Date format enables you to define a field as a date, then manipulate the field value and display that value in ways appropriate to a date. Using date format, you can:


Top of page

x
Date Display Options

Reference:

The date format does not specify type or length. Instead, it specifies date component options (D, W, M, Q, Y, and YY) and display options. These options are shown in the following chart.

Display Option

Meaning

Effect

D

Day

Prints a value from 1 to 31 for the day.

M

Month

Prints a value from 1 to 12 for the month.

Y

Year

Prints a two-digit year.

YY

Four-digit year

Prints a four-digit year.

T

Translate month or day

Prints a three-letter abbreviation for months in uppercase, if M is included in the USAGE specification. Otherwise, it prints day of week.

t

Translate month or day

Functions the same as uppercase T (described above), except that the first letter of the month or day is uppercase and the following letters are lowercase.*

TR

Translate month or day

Functions the same as uppercase T (described above), except that the entire month or day name is printed instead of an abbreviation.

tr

Translate month or day

Functions the same as lowercase t (described above), except that the entire month or day name is printed instead of an abbreviation.*

Q

Quarter

Prints Q1 - Q4.

W

Day-of-Week

If it is included in a USAGE specification with other date component options, prints a three-letter abbreviation of the day of the week in uppercase. If it is the only date component option in the USAGE specification, it prints the number of the day of the week (1-7; Mon=1).

w

Day-of-Week

Functions the same as uppercase W (described above), except that the first letter is uppercase and the following letters are lowercase.*

WR

Day-of-Week

Functions the same as uppercase W (described above), except that the entire day name is printed instead of an abbreviation.

wr

Day-of-Week

Functions the same as lowercase w (described above), except that the entire day name is printed instead of an abbreviation.*

J[UL]or JULIAN

Julian format

Prints date in Julian format.

YYJ[UL]

Julian format

Prints a Julian format date in the format YYYYDDD. The 7-digit format displays the four-digit year and the number of days counting from January 1. For example, January 3, 2001 in Julian format is 2001003.

*Note: When using these display options, be sure they are actually stored in the Master File as lowercase letters.

The following combinations of date components are not supported in date formats:

I2M, A2M, I2MD, A2MD


x
Reference: How Field Formats Y, YY, M, and W Are Stored

The Y, YY, and M formats are not smart dates. Smart date formats YMD and YYMD are stored as an offset from the base date of 12/31/1900. Smart date formats YM, YQ, YYM, and YYQ are stored as an offset from the base date 01/1901. W formats are stored as integers with a display length of one, containing values 1-7 representing the days of the week. Y, YY, and M formats are stored as integers. Y and M have display lengths of two. YY has a display length of four. When using Y and YY field formats, keep in mind these two important points:



x
Reference: Date Literals Interpretation Table

This table illustrates the behavior of date formats. The columns indicate the number of input digits for a date format. The rows indicate the usage or format of the field. The intersection of row and column describes the result of input and format.

Date Format

1

2

3

4

YYMD
     *
     *
CC00/0m/dd
CC00/mm/dd
MDYY
     *
     *
     *
     *
DMYY
     *
     *
     *
     *
YMD
     *
     *
CC00/0m/dd
CC00/mm/dd
MDY
     *
     *
     *
     *
DMY
     *
     *
     *
     *
YYM
CC00/0m
 CC00/mm
CC0y/mm
CCyy/mm
MYY
     *
     *
     *
     *
YM
CC00/0m
 CC00/mm
CC0y/mm
CCyy/mm
MY
     *
     *
0m/CCyy
mm/CCyy
M
0m
mm
     *
     *
YYQ
CC00/q
CC0y/q
CCyy/q
0yyy/q
QYY
     *
     *
q/CCyy
     *
YQ
CC00/q
CC0y/q
CCyy/q
0yyy/q
QY
     *
     *
q/CCyy
     *
Q 
q
     *
     *
     *
JUL
00/00d
00/0dd
00/ddd
0y/ddd
YYJUL
CC00/00d
CC00/0dd
CC00/ddd
CC0y/ddd
YY 
000y
00yy
0yyy
yyyy
Y
0y
yy
     *
     *
D
0d
dd
     *
     *
W
w
      *
     *
     *

Date Format

5

6

7

8

YYMD
CC0y/mm/dd
CCyy/mm/dd
0yyy/mm/dd
yyyy/mm/dd
MDYY
0m/dd/CCyy
mm/dd/CCyy
0m/dd/yyyy
mm/dd/yyyy
DMYY
0d/mm/CCyy
dd/mm/CCyy
0d/mm/yyyy
dd/mm/yyyy
YMD
CC0y/mm/dd
CCyy/mm/dd
0yyy/mm/dd
yyyy/mm/dd
MDY
0m/dd/CCyy
mm/dd/CCyy
0m/dd/yyyy
mm/dd/yyyy
DMY
0d/mm/CCyy
dd/mm/CCyy
0d/mm/yyyy
dd/mm/yyyy
YYM
0yyy/mm
yyyy/mm
      *
      *
MYY
0m/yyyy
mm/yyyy
      *
      *
YM
0yyy/mm
yyyy/mm
      *
      *
MY
0m/yyyy
mm/yyyy
      *
      *
M
      *
      *
      *
      *
YYQ
yyyy/q
      *
      *
      *
QYY
q/yyyy
      *
      *
      *
YQ
yyyy/q
      *
      *
      *
QY
q/yyyy
      *
      *
      *
Q
      *
      *
      *
      *
JUL
yy/ddd
      *
      *
      *
YYJUL
CCyy/ddd
0yyy/ddd
yyyy/ddd
      *
YY
      *
      *
      *
      *
Y
      *
      *
      *
      *
D
      *
      *
      *
      *
W
      *
      *
      *
      *

Note:


Top of page

x
Controlling the Date Separator

You can control the date separators when the date appears. In basic date format, such as YMD and MDYY, the date components appear separated by a slash character (/). The same is true for the year-month format, which appears with the year and quarter separated by a blank (for example, 94 Q3 or Q3 1994). The single component formats display just the single number or name.

The separating character can also be a period, a dash, or a blank, or can even be eliminated entirely. The following table shows the USAGE specifications for changing the separating character.

Format

Display

YMD
93/12/24
Y.M.D
93.12.24
Y-M
93-12
YBMBD
93 12 24

(The letter B signifies blank spaces.)

Y|M|D
931224

(The concatenation symbol (|) eliminates the separation character.)

Note:



x
Date Translation

Numeric months and days can be replaced by a translation, such as JAN, January, Wed, or Wednesday. The translated month or day can be abbreviated to three characters or fully spelled out. It can appear in either uppercase or lowercase. In addition, the day of the week (for example, Monday) can be appended to the beginning or end of the date. All of these options are independent of each other.

Translation

Display

MT
JAN
Mt
Jan
MTR
JANUARY
Mtr
January
WR
MONDAY
wr
Monday


Example: Using a Date Format

The following chart shows sample USAGE and ACTUAL formats for data stored in a non-FOCUS data source. The Value column shows the actual data value, and the Display column shows how the data appears.

USAGE

ACTUAL

Value

Display

wrMtrDYY
A6YMD
990315
Monday, March 15 1999
YQ
A6YMD
990315
99 Q1
QYY
A6YMD
990315
Q1 1999
YMD
A6
990315
99/03/15
MDYY
A6YMD
990315
03/15/1999

Note that the date attributes in the ACTUAL format specify the order in which the date is stored in the non-FOCUS data source. If the ACTUAL format does not specify the order of the month, day, and year, it is inferred from the USAGE format.



x
Using a Date Field

A field formatted as a date is automatically validated when entered. It can be entered as a natural date literal (for example, JAN 12 1999) or as a numeric date literal (for example, 011299).

Natural date literals enable you to specify a date in a natural, easily understandable way, by including spaces between date components and using abbreviations of month names. For example, April 25, 1999 can be specified as any of the following natural date literals:

APR 25 1999
25 APR 1999
1999 APR 25

Natural date literals can be used in all date computations, and all methods of data source updating. The following code shows examples:

In WHERE screening                   WHERE MYDATE IS 'APR 25 1999'
In arithmetic expressions            MYDATE - '1999 APR 25'
In computational date comparisons    IF MYDATE GT '25 APR 1999'In comma-delimited data          ...,MYDATE = APR 25 1999, ...

The following chart describes the format of natural date literals.

Literal

Format

Year-month-day

Four-digit year, uppercase three-character abbreviation, or uppercase full name, of the month, and one-digit or two-digit day of the month (for example, 1999 APR 25 or APRIL 25 1999).

Year-month

Year and month as described above.

Year-quarter

Year as described above, Q plus quarter number for the quarter (for example, 1999 Q3).

Month

Month as described above.

Quarter

Quarter as described above.

Day of week

Three-character, uppercase abbreviation, or full, uppercase name, of the day (for example, MON or MONDAY).

The date components of a natural date literal can be specified in any order, regardless of their order in the USAGE specification of the target field. Date components are separated by one or more blanks.

For example, if a USAGE specification for a date field is YM, a natural date literal written to that field can include the year and month in any order. MAY 1999 and 1990 APR are both valid literals.



x
Numeric Date Literals

Numeric date literals differ from natural date literals in that they are simple strings of digits. The order of the date components in a numeric date literal must match the order of the date components in the corresponding USAGE specification. In addition, the numeric date literal must include all of the date components included in the USAGE specification. For example, if the USAGE specification is DMY, then April 25 1999 must be represented as:

250499

Numeric date literals can be used in all date computations and all methods of data source updating.


Top of page

x
Date Fields in Arithmetic Expressions

The general rule for manipulating date fields in arithmetic expressions is that date fields in the same expression must specify the same date components. The date components can be specified in any order, and display options are ignored. Y or YY, Q, M, W, and D are valid components.

Note that arithmetic expressions assigned to quarters, months, or days of the week are computed modulo 4, 12, and 7, respectively, so that anomalies like fifth quarters and thirteenth months are avoided.

For example, if NEWQUARTER and THISQUARTER both have USAGE specifications of Q, and the value of THISQUARTER is 2, then the following statement gives NEWQUARTER a value of 1 (that is, the remainder of 5 divided by 4):

NEWQUARTER = THISQUARTER + 3

Top of page

x
Converting a Date Field

How to:

Two types of conversion are possible: format conversion and date component conversion. In the first case, the value of a date format field can be assigned to an alphanumeric or integer field that uses date display options (see the following section). The reverse conversion is also possible.

In the second case, a field whose USAGE specifies one set of date components can be assigned to another field specifying different date components.

For example, the value of REPORTDATE (DMY) can be assigned to ORDERDATE (Y). In this case, the year is being extracted from REPORTDATE. If REPORTDATE is Apr 27 99, ORDERDATE is 99.

You can also assign the value of ORDERDATE to REPORTDATE. If the value of ORDERDATE is 99, the value of REPORTDATE is Jan 1 99. In this case, REPORTDATE is given values for the missing date components.



x
Syntax: How to Convert a Date Field
field1/format = field2;

where:

field1

Is a date format field, or an alphanumeric or integer format field using date display options.

format

Is the USAGE (or FORMAT) specification of field1 (the target field).

field2

Is a date format field, or an alphanumeric or integer format field using date display options. The format types (alphanumeric, integer, or date) and the date components (YY, Y, Q, M, W, D) of field1 and field2 do not need to match.


Top of page

x
How a Date Field Is Represented Internally

Date fields are represented internally as four-byte binary integers indicating the time elapsed since the date format base date. For each field, the unit of elapsed time is that field smallest date component.

For example, if the USAGE specification of REPORTDATE is MDY, then elapsed time is measured in days, and internally the field contains the number of days elapsed between the entered date and the base date. If you enter the numeric literal for February 13, 1964 (that is, 021364), and then print the field in a report, 02/13/64 appears. If you use it in the equation:

NEWDATE = 'FEB 28 1964' - REPORTDATE ;
DAYS/D = NEWDATE ;

then the value of DAYS is 15. However, the internal representation of REPORTDATE is a four-byte binary integer representing the number of days between December 31, 1900 and February 13, 1964.

Just as the unit of elapsed time is based on a field smallest date component, so too is the base date. For example, for a YQ field, elapsed time is measured in quarters, and the base date is the first quarter of 1901. For a YM field, elapsed time is measured in months, and the base date is the first month of 1901.

To display blanks or the actual base date in a report, use the SET DATEDISPLAY command described in the Developing Reporting Applications manual. The default value, OFF, displays blanks when a date matches the base date. ON displays the actual base date value.

You do not need to be concerned with the date format internal representation, except to note that all dates set to the base date appear as blanks, and all date fields that are entered blank or as all zeroes are accepted during validation and interpreted as the base date. They appear as blanks, but are interpreted as the base date in date computations and expressions.


Top of page

x
Displaying a Non-Standard Date Format

How to:

By default, if a date field in a non-FOCUS data source contains an invalid date, a message appears and the entire record fails to appear in a report. For example, if a date field contains '980450' with an ACTUAL of A6 and a USAGE of YMD, the record containing that field does not appear. The SET ALLOWCVTERR command enables you to display the rest of the record that contains the incorrect date.

Note: The ALLOWCVTERR parameter is not supported for virtual fields.



x
Syntax: How to Invoke ALLOWCVTERR
SET ALLOWCVTERR = {ON|OFF}

where:

ON

Enables you to display a field containing an incorrect date.

OFF

Generates a diagnostic message if incorrect data is encountered, and does not display the record containing the bad data. OFF is the default value.

When a bad date is encountered, ALLOWCVTERR sets the value of the field to either MISSING or to the base date, depending on whether MISSING=ON.

The following chart shows the results of interaction between DATEDISPLAY and MISSING, assuming ALLOWCVTERR=ON and the presence of a bad date.

 

MISSING=OFF

MISSING=ON

DATEDISPLAY=ON

Displays Base Date 19001231 or 1901/1

.

DATEDISPLAY=OFF

Displays Blanks

.

DATEDISPLAY affects only how the base date appears. See the Developing Reporting Applications manual for a description of DATEDISPLAY.


Top of page

x
Date Format Support

Date format fields are used in special ways with the following facilities:


Top of page

x
Alphanumeric and Numeric Formats With Date Display Options

In addition to the standard date format, you can also represent a date by using an alphanumeric, integer, or packed-decimal field with date display options (D, M, Y, and T). Note, however, that this does not offer the full date support that is provided by the standard date format.

Alphanumeric and integer fields used with date display options have some date functionality when used with special date functions, as described in the Creating Reports With WebFOCUS Language manual.

When representing dates as alphanumeric or integer fields with date display options, you can specify the year, month, and day. If all three of these elements are present, then the date has six digits (or eight if the year is presented as four digits), and the USAGE can be:

Format

Display

I6MDY
04/21/98
I6YMD
98/04/21
P6DMY
21/04/98
I8DMYY
21/04/1998

The number of a month (1 to 12) can be translated to the corresponding month name by adding the letter T to the format, immediately after the M. For instance:

Format

Data

Display

I6MTDY
05/21/98
MAY 21 98
I4MTY
0698
JUN 98
I2MT
07
JUL

If the date has only the month element, a format of I2MT displays the value 4 as APR, for example. This is particularly useful in reports where columns or rows are sorted by month. They then appear in correct calendar order. For example, JAN, FEB, MAR, because the sorting is based on the numerical, not alphabetical, values. (Note that without the T display option, I2M is interpreted as an integer with a floating dollar sign.)



x
Date-Time Formats

How to:

The date-time data type supports both the date and time, similar to the timestamp data types available in many relational data sources.

Date-time fields are stored in eight, ten, or 12 bytes: four bytes for date and either four, six, or eight bytes for time, depending on whether the format specifies a microsecond or nanosecond.

Computations only allow direct assignment within data types: alpha to alpha, numeric to numeric, date to date, and date-time to date-time. All other operations are accomplished through a set of date-time functions. See the Using Functions manual for information on subroutines for manipulating date-time fields.

Date-time formats can also produce output values and accept input values that are compatible with the ISO 8601:2000 date-time notation standard. A SET parameter and specific formatting options enable this notation.



x
Syntax: How to Enable ISO Standard Date-Time Notation
SET DTSTANDARD = {OFF|ON|STANDARD|STANDARDU}

where:

OFF

Does not provide compatibility with the ISO 8601:2000 date-time notation standard. OFF is the default value.

ON|STANDARD

Enables recognition and output of the ISO standard formats, including use of T as the delimiter between date and time, use of period or comma as the delimiter of fractional seconds, use of Z at the end of universal times, and acceptance of inputs with time zone information. STANDARD is a synonym for ON.

STANDARDU

Enables ISO standard formats (like STANDARD) and also, where possible, converts input strings to the equivalent universal time (formerly known as Greenwich Mean Time), thus enabling applications to store all date-time values in a consistent way.



Example: Using SET DTSTANDARD

The following request displays date-time values input in ISO 8601:2000 date-time standard formats. With SET DTSTANDARD=OFF, the request terminates with a (FOC177): INVALID DATE CONSTANT:

SET DTSTANDARD = &STAND
DEFINE FILE EMPLOYEE
-* The following input is format YYYY-MM-DDThh:mm:ss.sTZD
DT1/HYYMDs  =     DT(2004-06-01T19:20:30.45+01:00);
-* The following input has comma as the decimal separator
DT2/HYYMDs  =     DT(2004-06-01T19:20:30,45+01:00);
DT3/HYYMDs  =     DT(20040601T19:20:30,45);
DT4/HYYMDUs =     DT(2004-06-01T19:20:30,45+01:00);
END
TABLE FILE EMPLOYEE
HEADING CENTER
"DTSANDARD = &STAND "
" "
SUM CURR_SAL NOPRINT DT1 AS 'DT1: INPUT = 2004-06-01T19:20:30.45+01:00'
OVER DT2 AS 'DT2: INPUT = 2004-06-01T19:20:30,45+01:00'
OVER DT3 AS 'DT3: INPUT = 20040601T19:20:30,45'
OVER DT4 AS 'DT4: OUTPUT  FORMAT HYYMDUs'
END

With DTSTANDARD= STANDARD, the output shows that the input values were accepted, but the time zone offsets in DT1, DT2, and DT4 (+01:00) were ignored on output. The character U in the format for DT4 causes the T separator to be used between the date and the time:

                      DTSANDARD = STANDARD                        
                                                                  
DT1: INPUT = 2004-06-01T19:20:30.45+01:00  2004-06-01 19:20:30.450
DT2: INPUT = 2004-06-01T19:20:30,45+01:00  2004-06-01 19:20:30.450
DT3: INPUT = 20040601T19:20:30,45          2004-06-01 19:20:30.450
DT4: OUTPUT  FORMAT HYYMDUs                2004-06-01T19:20:30.450

With DTSTANDARD= STANDARDU, the output shows that the values DT1, DT2, and DT4 were converted to universal time by subtracting the time zone offsets (+01:00):

                      DTSANDARD = STANDARDU                       
                                                                  
DT1: INPUT = 2004-06-01T19:20:30.45+01:00  2004-06-01 18:20:30.450
DT2: INPUT = 2004-06-01T19:20:30,45+01:00  2004-06-01 18:20:30.450
DT3: INPUT = 20040601T19:20:30,45          2004-06-01 19:20:30.450
DT4: OUTPUT  FORMAT HYYMDUs                2004-06-01T18:20:30.450

Top of page

x
Describing a Date-Time Field

How to:

Reference:

In a Master File, the USAGE (or FORMAT) attribute determines how date-time field values appear in report output and forms, and how they behave in expressions and functions. For FOCUS data sources, it also determines how they are stored.

Format type H describes date-time fields. The USAGE attribute for a date-time field contains the H format code and can identify either the length of the field or the relevant date-time display options.

The MISSING attribute for date-time fields can be ON or OFF. If it is OFF, and the date-time field has no value, it defaults to blank.



x
Syntax: How to Describe a Numeric Date-Time Value Without Display Options

This format is appropriate for alphanumeric HOLD files or transaction files.

USAGE = Hn

where:

n

Is the field length, from 1 to 23, including up to eight characters for displaying the date and up to nine, 12, or 15 characters for the time. For lengths less than 20, the date is truncated on the right.

An eight-character date includes four digits for the year, two for the month, and two for the day of the month, YYYYMMDD.

A nine-character time includes two digits for the hour, two for the minute, two for the second, and three for the millisecond, HHMMSSsss. The millisecond component represents the decimal portion of the second to three places.

A twelve-character time includes two digits for the hour, two for the minute, two for the second, three for the millisecond, and three for the microsecond, HHMMSSsssmmm. The millisecond component represents the decimal portion of the second value to three places. The microsecond component represents three additional decimal places beyond the millisecond value.

A fifteen-character time includes two digits for the hour, two for the minute, two for the second, three for the millisecond, three for the microsecond and three for the nanosecond, HHMMSSsssmmmnnn. The millisecond component represents the decimal portion of the second value to three places. The microsecond component represents three additional decimal places beyond the millisecond value. The nanosecond component represents three additional decimal places beyond the microsecond value.

With this format, there are no spaces between the date and time components, no decimal points, and no spaces or separator characters within either component. The time must be entered using the 24-hour system. For example, the value 19991231225725333444 represents 1999/12/31 10:57:25.333444PM.



x
Syntax: How to Describe a Time-Only Value
USAGE = Htimefmt1

where:

timefmt1

Is the USAGE format for displaying time only. Hour, minute, and second components are always separated by colons (:), with no intervening blanks. A time value can have a blank immediately preceding an am/pm indicator. For information, see Display Options for a Time-Only Value.



x
Reference: Display Options for a Time-Only Value

The following table lists the valid time display options for a time-only USAGE attribute. Assume the time value is 2:05:27.123456444 a.m.

Option

Meaning

Effect

H

Hour (two digits).

If the format includes the option a, b, A, or B, the hour value is from 01 to 12.

Otherwise, the hour value is from 00 to 23, with 00 representing midnight.

Prints a two-digit hour. For example:

USAGE = HH prints 02

h

Hour with zero suppression.

If the format includes the option a, b, A, or B, the hour value is from 1 to 12.

Otherwise, the hour is from 0 to 23.

Displays the hour with zero suppression. For example:

USAGE = Hh prints 2

I

Minute (two digits).

The minute value is from 00 to 59.

Prints the two-digit minute. For example:

USAGE = HHI prints 02:05

i

Minute with zero suppression.

The minute value is from 0 to 59.

Prints the minute with zero suppression. This cannot be used together with an hour format (H or h). For example:

USAGE = Hi prints 5

S[x]

Second (two digits). You can specify up to nine decimal places after the seconds value using the x option, where x is a number from 1 to 9. Alternatively, you can use the s, m, and n formats to display three, six, or nine decimal places.

S: 00 to 59

Prints the two-digit second. For example:

USAGE = HHIS prints 02:05:27

USAGE = HHIS1 prints 02:05:27.1

s

Millisecond (three digits, after the decimal point in the second).

000 to 999

Prints the second to three decimal places. For example:

USAGE = HHISs prints 02:05:27.123

m

Microsecond (three additional digits after the millisecond).

000 through 999

Prints the second to six decimal places. For example:

USAGE = HSsm prints 27.123456

n

Nanosecond (three additional digits after the microsecond).

000 through 999

Prints the second to nine decimal places. For example:

USAGE = HSsn prints 27.123456444

A

12-hour time display with AM or PM in uppercase.

Prints the hour from 01 to 12, followed by AM or PM. For example:

USAGE = HHISA prints 02:05:27AM

a

12-hour time display with am or pm in lowercase.

Prints the hour from 01 to 12, followed by am or pm. For example:

USAGE = HHISa prints 02:05:27am

B

12-hour time display with AM or PM in uppercase, with a blank space before the AM or PM.

Prints the hour from 01 to 12, followed by a space and then AM or PM. For example:

USAGE = HHISB prints 02:05:27 AM

b

12-hour time display with am or pm in lowercase, with a blank space before the am or pm.

Prints the hour from 01 to 12, followed by a space followed by am or pm. For example:

USAGE = HHISb prints 02:05:27 am

Z

24-hour time display with Z to indicate universal time. Z is incompatible with AM/PM output.

Prints the hour from 01 to 24, followed by Z. For example:

USAGE = HHISZ prints 14:30[:20.99]Z

When the format includes more than one time display option:

  • The options must appear in the order hour, minute, second, millisecond, microsecond, nanosecond.
  • The first option must be either hour, minute, or second.
  • No intermediate component can be skipped. If hour is specified, the next option must be minute. It cannot be second.

Note: Unless you specify one of the AM/PM time display options, the time component appears using the 24-hour system.



x
Syntax: How to Describe a Date-Time Value
USAGE = Hdatefmt [separator] [timefmt2]

where:

datefmt

Is the USAGE format for displaying the date portion of the date-time field. For information, see Display Options for the Date Component of a Date-Time Field.

separator

Is a separator between the date components. The default separator is a slash (/). Other valid separators are: period (.), hyphen (-), blank (B), or none (N). With translated months, these separators can only be specified when the k option is not used.

With the STANDARD and STANDARDU settings, the separator for dates is always hyphen. The separator between date and time is blank by default. However, if you specify the character U as the separator option, the date and time will be separated by the character T.

timefmt2

Is the format for a time that follows a date. Time is separated from the date by a blank. Time components are separated from each other by colons. Unlike the format for time alone, a time format that follows a date format consists of at most two characters: a single character to represent all of the time components that appear and, optionally, one character for an AM/PM option. For information, see Display Options for the Time Component of a Date-Time Field.



x
Reference: Display Options for the Date Component of a Date-Time Field

The date format can include the following display options, as long as they conform to the allowed combinations. In the following table, assume the date is February 5, 1999.

Option

Meaning

Example

Y

2-digit year

99
YY

4-digit year

1999
M

2-digit month (01 - 12)

02
MT

Full month name

February
Mt

Short month name

Feb
D

2-digit day

05
d

Zero-suppressed day. A blank space replaces the zero.

 5
e

Zero-removed day. The day number is shifted to the left, and any components to the right of this are shifted to the left.

Requires a date separator.

5
o

Zero-removed month. Automatically implements the e option for a zero-removed day. The month and day numbers are shifted to the left, and any components to the right of these are also shifted.

Required a date separator.

5
k

For formats in which month or day is followed by year, and month is translated to a short or full name, k separates the year from the day with a comma and blank. Otherwise, the separator is a blank.

USAGE = HMtDkYY
prints Feb 05, 1999

Note: Unless you specify one of the AM/PM time display options, the time component uses the 24-hour system.



Example: Using Zero Removal for Date-Time Month and Day Numbers

The following request creates the date-time value 01/01/2013. It then displays this value using:

DEFINE FILE GGSALES           
DATE1A/HMDYY = DT(01/01/2013);
DATE1B/HoeYY = DATE1A;        
DATE1C/HodYY = DATE1A;        
DATE1D/HMeYY = DATE1A;        
END                           
TABLE FILE GGSALES            
SUM DOLLARS NOPRINT           
DATE1A AS 'HMDYY'             
DATE1B AS 'HoeYY'             
DATE1C AS 'HodYY'             
DATE1D AS 'HMeYY'             
ON TABLE SET PAGE NOPAGE      
END

The output is:

HMDYY       HoeYY       HodYY       HMeYY    
-----       -----       -----       -----    
01/01/2013  1/1/2013    1/1/2013    01/1/2013


Example: Comparing Zero Suppression With Zero Removal

The following request creates two dates with date-time formats in which the date component has a leading zero (01). In the first date, the day component is the first component and displays on the left. In the second date, the day component is the second component and displays in the middle. The request prints these dates:

DEFINE FILE GGSALES           
DATE1A/HDMYY = DT(01/12/2012);
DATE2A/HMDYY = DT(12/01/2012);
DATE1B/HdMYY = DATE1A;        
DATE2B/HMdYY = DATE2A;        
DATE1C/HeMYY = DATE1A;        
DATE2C/HMeYY = DATE2A;        
END                           
TABLE FILE GGSALES            
SUM DOLLARS NOPRINT           
DATE1A AS 'HDMYY'             
DATE2A AS ''      OVER        
DATE1B AS 'HdMYY'             
DATE2B AS ''      OVER        
DATE1C AS 'HeMYY'             
DATE2C AS ''                  
ON TABLE SET PAGE NOPAGE

On the output, the first row shows the date with all zeros displayed. The second row shows zero suppression of the day number, where the zero has been replaced by a blank space so that all the components are aligned with the components on row 1. The last row shows zero removal, where the zero has been removed from the day number, and all of the remaining characters have been shifted over to the left:

HDMYY  01/12/2012    12/01/2012
HdMYY   1/12/2012    12/ 1/2012
HeMYY  1/12/2012     12/1/2012


x
Reference: Display Options for the Time Component of a Date-Time Field

The following table lists the valid options. Assume the date is February 5, 1999 and the time is 02:05:25.444555333 a.m.

Option

Meaning

Example

H

Prints hour.

USAGE = HYYMDH prints 1999/02/05 02

I

Prints hour:minute.

USAGE = HYYMDI prints 1999/02/05 02:05

S[x]

Prints hour:minute:second. If you specify the x option, where x is a number from 1 to 9, the seconds displays with x decimal digits. Alternatively, you can specify the s, m, or n option to display the seconds with three, six, or nine decimal digits.

USAGE = HYYMDS prints 1999/02/05 02:05:25

USAGE = HYYMDS1 prints 1999/02/05 02:05:25.4

s

Prints hour:minute:second.millisecond.

USAGE = HYYMDs prints 1999/02/05 02:05:25.444

m

Prints hour:minute:second.microsecond.

USAGE = HYYMDm prints 1999/02/05 02:05:25.444555

n

Prints hour:minute:second.nanosecond.

USAGE = HYYMDn prints 1999/02/05 02:05:25.444555333

A

Prints AM or PM. This uses the 12-hour system and causes the hour to be printed with zero suppression.

USAGE = HYYMDSA prints 1999/02/05 2:05:25AM

a

Prints am or pm. This uses the 12-hour system and causes the hour to be printed with zero suppression.

USAGE = HYYMDSa prints 1999/02/05 2:05:25am

B

Prints AM or PM preceded by a blank space. This uses the 12-hour system and causes the hour to be printed with zero suppression.

USAGE = HYYMDSB prints 1999/02/05 2:05:25 AM

b

Prints am or pm preceded by a blank space. This uses the 12-hour system and causes the hour to be printed with zero suppression.

USAGE = HYYMDSb prints 1999/02/05 2:05:25 am

Z

Prints Z to indicate universal time. This uses the 24-hour system. Z is incompatible with AM/PM output.

USAGE = HHISZ prints 14:30[:20.99]Z

The date components can be in any of the following combinations and order:

  • Year-first combinations: Y, YY, YM, YYM, YMD, YYMD.
  • Month-first combinations: M, MD, MY, MYY, MDY, MDYY.
  • Day-first combinations: D, DM, DMY, DMYY.


x
Reference: Date-Time Usage Notes

Top of page

x
Character Format AnV

How to:

Reference:

The character format AnV is supported in Master Files for FOCUS, XFOCUS, and relational data sources. This format is used to represent the VARCHAR (variable length character) data types supported by relational database management systems.

For relational data sources, AnV keeps track of the actual length of a VARCHAR column. This information is important when the value is used to populate a VARCHAR column in a different RDBMS. It affects whether trailing blanks are retained in string concatenation and, for Oracle, string comparisons (the other relational engines ignore trailing blanks in string comparisons).

In a FOCUS or XFOCUS data source, AnV does not provide true variable length character support. It is a fixed-length character field with two extra leading bytes to contain the actual length of the data stored in the field. This length is stored as a short integer value occupying two bytes. Trailing blanks entered as part of an AnV field count in its length.

Note: Because of the two bytes of overhead and the additional processing required to strip them, AnV format is not recommended for use in non-relational data sources.



x
Syntax: How to Specify AnV Fields in a Master File
FIELD=name, ALIAS=alias, USAGE=AnV [,ACTUAL=AnV] , $

where:

n

Is the size (maximum length) of the field. It can be from 1 to 4093. Note that because of the additional two bytes used to store the length, an A4093V field is actually 4095 bytes long. A size of zero (A0V) is not supported. The length of an instance of the field can be zero.

Note: HOLD FORMAT ALPHA creates an ACTUAL format of AnW in the Master File. See Propagating an AnV Field to a HOLD File.



Example: Specifying the AnV Format in a Master File

The following represents a VARCHAR field in a Master File for a DB2 data source with size 200:

$ VARCHAR FIELD USING AnV
  FIELD=VARCHAR200, ALIAS=VC200, USAGE=A200V, ACTUAL=A200V, MISSING=ON ,$

The following represents an AnV field in a Master File for a FOCUS data source with size 200:

FIELD=ALPHAV, ALIAS=AV200, USAGE=A200V, MISSING=ON ,$

If a data source has an AnV field, specify the following in order to create a HOLD FORMAT ALPHA file without the length designator:

FIELD=ALPHA, USAGE=A25, ACTUAL=A25V, $

or

DEFINE ...
  ALPHA/A25 = VARCHAR ;
END

or

COMPUTE ALPHA/A25 = VARCHAR ;

In order to alter or create a Master File to include AnV, the data must be converted and the length added to the beginning of the field. For example, issue a HOLD command when the field is described as follows:

FIELD=VARCHAR, ,USAGE=A25V, ACTUAL=A25, $

or

DEFINE ...
  VARCHAR/A25V = ALPHA ;
END

or

COMPUTE VARCHAR/A25V = ALPHA ;


x
Reference: Usage Notes for AnV Format


x
Reference: Propagating an AnV Field to a HOLD File

When a user propagates an AnV field to a sequential data source using the HOLD FORMAT ALPHA command, the two-byte integer length is converted to a six-digit alphanumeric length. The field in the HOLD file consists of this six-digit number followed by the character data. The format attributes for this field are:

... USAGE=AnV, ACTUAL=AnW

AnW is created as a by-product of HOLD FORMAT ALPHA. However, it can be read and used for input as necessary. The number of bytes occupied by this field in the HOLD file is 6+n.



Example: Propagating an AnV Field to a HOLD File

The A39V field named TITLEV, is propagated to the HOLD file as:

FIELDNAME = TITLEV ,E03 ,A39V ,A39W ,$

In a binary HOLD file, the USAGE and ACTUAL formats are AnV, although the ACTUAL format may be padded to a full 4-byte word. The number of bytes occupied by this field in the HOLD file is 2+n.

When an AnV field is input into a data source, all bytes in the input field beyond the given length are ignored. These bytes are set to blanks as part of the input process.

When a user creates a relational data source using the HOLD FORMAT sqlengine command, the AnV field generates a VARCHAR column in the relational data source.

For example, the A39V field named TITLEV, is propagated to a HOLD FORMAT DB2 file as:

FIELDNAME = 'TITLEV', 'TITLEV', A39V, A39V ,$

Top of page

x
Text Field Format

How to:

You can store any combination of characters as a text field.



x
Syntax: How to Specify a Text Field in a Master File
FIELD = fieldname, ALIAS = aliasname, USAGE = TXn[F],$

where:

fieldname

Is the name you assign the text field.

aliasname

Is an alternate name for the field name.

n

Is the output display length in TABLE for the text field. The display length may be between 1 and 256 characters.

All letters, digits, and special characters can be stored with this format. The following are some sample text field formats.

Format

Display

TX50
This course provides the DP professional with the skills needed to create, maintain, and report from FOCUS data sources.
TX35
This course provides the DP professional with the skills needed to create, maintain, and report from FOCUS data sources.

The standard edit options are not available for the text field format.



x
Reference: Usage Notes for Text Field Format

WebFOCUS