EDIT edits a field for display. To edit a computed field for display, see EDIT COMPUTATION.
Syntax:
►►─── EDIt ─┬─────────────────────────────────────┬───────────────────────────► ├─┬────────────┬─ record-name. ───────┤ │ └─ view-id. ─┘ │ └─ logical-record-name.element-name. ─┘ ►─── field-name ─┬─────────────────────────┬─────────────────────────────────► │ ┌───── , ─────┐ │ └─ ( -▼- subscript ─┴─ ) ─┘ ►─┬───────────────────────────┬──────────────────────────────────────────────► └─ VIEw ─┬─────┬─ view-id. ─┘ └─ = ─┘ ┌─────────────────────────────────────────────────────────┐ ►─▼─┬─┬─ DISplay ◄ ───┬───────────────────────────────────┬─┴────────────────►◄ │ └─ HEXadecimal ─┘ │ ├─┬─ COMmas ─────┬────────────────────────────────────┤ │ └─ NOCommas ◄ ─┘ │ ├─┬─ $ ─────┬─────────────────────────────────────────┤ │ └─ NO$ ◄ ─┘ │ ├─┬─ LEAdzeros ─────┬─────────────────────────────────┤ │ └─ NOLeadzeros ◄ ─┘ │ │ ┌──────────────┐ │ ├─┬─ OLQheader ─┬─────┬─▼- olq-header ─┴─┬────────────┤ │ │ └─ = ─┘ │ │ │ └─ NOOlqheader ◄ ──────────────────────┘ │ ├─┬─ PICture ─┬─────┬─ external-picture ─┬────────────┤ │ │ └─ = ─┘ │ │ │ └─ NOPicture ◄ ────────────────────────┘ │ ├─┬─ code-table-expansion ──────────────────────────┬─┤ │ └─ NOCodetable ◄ ─────────────────────────────────┘ │ ├─┬─ SPArse ─┬────────────────────────────────────────┤ │ └─ FULl ───┘ │ └─ ALIgn ─┬─────┬─┬─ LEFt ───┬────────────────────────┘ └─ = ─┘ ├─ CENter ─┤ └─ RIGht ──┘
Expansion of code-table
►►─ CODetable ─┬─────┬─ code-table-name (version) ─┬───────────────────────┬──►◄ └─ = ─┘ └─ DISplay WIDth width ─┘
Parameters:
The alternate ID of the record or logical record name.
The database record name containing the field to be edited.
The logical record element name to be edited.
The name of the field to be edited. You can request editing for fields in database records and for dbkey fields. When field-name is a subscripted field, only OLQHEADER/NOOLQHEADER applies to individual occurrences of the repeating field.
If a repeating field name is specified without a subscript, all fields are displayed. If a repeating field requires more than one subscript, a second set of parentheses is required.
Specifies the alternate ID of the record or logical record name.
Specifies whether report fields are output in display or hexadecimal format.
When HEXADECIMAL is specified, all other output format options except OLQHEADER are ignored.
Specifies whether report fields are displayed with or without commas; nonnumeric fields are unaffected.
When you specify COMMAS, commas follow every third digit of numeric displays (counting backwards from implicit or explicit decimal positions).
Specifies whether report fields are displayed with or without dollar signs; nonnumeric fields are unaffected.
Specifies whether the numeric fields in the field list are displayed with or without leading zeros; nonnumeric fields are not affected.
Specifies that CA OLQ headers are used as headers for displayed data.
If the OLQHEADER option is used, associated CA OLQ headers replace the field names if any CA OLQ headers are defined in the data dictionary or if any are specified by the user with olq-header.
olq-header specifies one or more lines of user-supplied field headers. Any number of lines can be specified, up to one less than the maximum number of lines output on the terminal. CA OLQ reserves space for the display of at least one report detail line. If a blank space is included in any header line, it must be enclosed in quotation marks. When header-line is not specified for a particular field, CA OLQ uses the field header previously defined either in the data dictionary or through CA OLQ.
Note: To display CA OLQ headers (whether defined in the dictionary or supplied by the user), OPTIONS=OLQHEADER must be in effect.
Specifies that field names are used as headers for displayed data.
Specifies that external pictures are used to edit report fields.
A user-specified external picture overrides any external picture that exists for a field in the data dictionary.
The characters available for constructing alphanumeric, alphabetic, and numeric external pictures are presented in Table 3.
The following rules apply to external picture construction:
If the first significant edit character is an X, CA OLQ recognizes the field as containing alphanumeric data; characters other than X, B, or parentheses are treated as insertion characters.
If the first significant edit character is an A, CA OLQ recognizes the field as containing alphabetic data; characters other than A, B, or parentheses are treated as insertion characters.
If the first significant edit character is a 9, Z, or *, CA OLQ recognizes the field as containing numeric data; characters other than 9, Z, $, *, +, -, B, or parentheses are treated as insertion characters.
If the first significant edit character is a G, CA OLQ recognizes the field as containing double-byte character string (DBCS) characters; characters other than G, B, or parentheses are treated as insertion characters.
Note: When the value of a field is negative, CA OLQ will display insertion characters at the end of the numeric picture, thereby allowing the user to specify accounting information.
Several examples of user-specified pictures are shown in Table 4.
Note: External picture formats, whether specified with the EDIT command or defined in the data dictionary, are only used to edit fields when OPTIONS=PICTURE is in effect.
Requests a default picture to edit a report field. The default picture for a report field is derived from the internal picture stored in the data dictionary. Keep in mind the following:
Specifies whether a code table is used to format a report field. Code tables are defined and stored in the data dictionary by using the IDD DDDL Compiler.
Note: For further information on how to create code tables, see the CA IDMS IDD DDDL Reference Guide.
The NOT FOUND DDDL compiler keyword often is included in a code table to define a catch-all for an encoded value. NOT FOUND ensures that an unanticipated stored value is not displayed in the report file for the edited field. When an unanticipated value is retrieved for a field for which code table editing has been requested, the user-specified literal that is paired with the NOT FOUND keyword is automatically displayed.
If the NOT FOUND keyword is not listed in a table, CA OLQ displays asterisks (*) when an invalid stored value is retrieved.
A sample code table of months is shown below. For each encoded number found in the report file, CA OLQ displays a decoded month value. If an invalid number is found, the literal 'INVALID MONTH' is displayed:
ENCODED VALUE DECODED VALUE 01 JANUARY 02 FEBRUARY 03 MARCH . . . . . . . . . . 12 DECEMBER NOT FOUND 'INVALID MONTH'
Two types of code tables exist as follows:
Code table editing overrides all other editing that might be requested for a report column, including leading dollar signs, commas, leading zeros, hexadecimal notation, and external picture formatting.
Note: When code table formatting is requested for a report field, CA OLQ uses the decoded values for subsequent processing in both the SORT command and the WHERE clause.
Specifies that no code table is used to format a report field.
Specifies that only the first occurrence of a repeating column value is displayed. Note that OLQ suppresses a column display only when all of the following conditions are met:
Specifies that all the occurrences of a repeating report line are displayed.
Indicates that the data values for the specified columns are to be aligned within the column boundaries as follows:
The default for numeric fields is right, and the default for all other fields is left.
Table 3. Characters Used for Constructing External Pictures
|
Character |
Type of Data Described by the Character |
|---|---|
|
X |
A single alphanumeric character or double-byte character string (DBCS) character stored with no shiftstrings. |
|
B |
A single blank character. B can appear anywhere in the picture. |
|
(n) |
Follows any character to represent n consecutive repetitions of the specified character. N must be an integer in the range 1 through 9999. |
|
other |
Characters other than A, B, or parentheses can be used as insertion characters. |
|
9 |
A single numeric character (0 through 9). |
|
G |
A double-byte character string (DBCS) character stored with no shiftstrings. |
|
Z |
Z is an insertion character when it is preceded by a 9, a decimal point, or a zero-suppression character. Otherwise, Z is zero-suppression character. |
|
$ |
Multiple dollar signs at the beginning of an external picture represent a floating dollar sign. The dollar sign is an insertion character when it is preceded by a 9, a decimal point, or a zero-suppression character. |
|
* |
Multiple asterisks at the beginning of an external picture provide check protection. The asterisk is an insertion character when it is preceded by a 9, a decimal point, or a zero-suppression character. |
|
+ |
A plus sign in the first position of an external picture indicates signed data. Multiple plus signs at the beginning of an external picture represent a floating sign. The plus sign is an insertion character when it is preceded by a 9, a decimal point, or a zero-suppression character. |
|
- |
A minus sign in the first position of an external picture indicates signed data. Multiple minus signs at the beginning of an external picture represent a floating sign. The minus sign is an insertion character when it is preceded by a 9, a decimal point, or a zero-suppression character. |
|
. |
The period character is used as a decimal point. Data is aligned with the decimal point in an external picture, and is truncated or padded when necessary. The decimal point terminates zero suppression when zero-suppression precede the decimal point. Zero-suppression characters become insertion characters if placed after a decimal point. The first period in a series of period characters is the decimal point in a picture. If no decimal point exists in the data, a decimal point is assumed after the rightmost numeric character. |
Table 4. Examples of User-Specified Pictures
|
Data Stored |
Internal Picture |
External Picture |
Data Displayed |
|---|---|---|---|
|
123400M |
X(7) |
X(7) |
123400M |
|
123400M |
X(7) |
XBXXXXXBX |
1 23400 M |
|
JOHNSON |
A(4) |
A(4) |
JOHN |
|
TWOWORDS |
A(9) |
A(3)BA(5) |
TWO WORDS |
|
2350000 |
9(7) |
9(7) |
2350000 |
|
2350000 |
9(7) |
9(7).99 |
2350000.00 |
|
2350000 |
9(7) |
$$$,$$$,$$9.99 |
$2,350,000.00 |
|
2350000 |
9(7) |
99/99/999 |
23/50/000 |
|
00120 |
9(5) |
ZZZZZ |
120 |
|
9876 |
9(4) |
+++99 |
+9876 |
Examples:
The following examples illustrate the use of the EDIT command to format report fields, based on the report built with the SELECT statement shown below:
select emp-last-name-0415, ss-number-0415, salary-amount-0420 from employee, emposition where emp-emposition EMPLOYEE/EMPOSITION REPORT mm/dd/yy EMP-LAST-NAME-0415 SS-NUMBER-0415 SALARY-AMOUNT-0420 LINGER 92345812 38500.00 TERNER 45672222 13000.00 LINGER 19556712 42500.00 LINGER 19556712 38000.00 PENMAN 14593186 39000.00 LINGER 10673343 85000.00 LINGER 10673343 75000.00 LITERATA 23567831 37500.00 WILCO 111000023 80000.00 HEAROWITZ 31896154 33000.00 TYRO 19893456 20000.00 KAHALLY 29661234 20000.00 PAPAZEUS 22887770 100000.00 PAPAZEUS 22887770 90000.00 - 1 -
Edit a Field
The report built above is too wide to fit on one terminal screen. Use EDIT to fit all the columns on one terminal screen:
edit emp-last-name-0415 pic 'x(10)' ! display EMPLOYEE/EMPOSITION REPORT mm/dd/yy EMP-LAST-NAME-0415 SS-NUMBER-0415 SALARY-AMOUNT-0420 LINGER 92345812 38500.00 TERNER 45672222 13000.00 LINGER 19556712 42500.00 LINGER 19556712 38000.00 PENMAN 14593186 39000.00 LINGER 10673343 85000.00 LINGER 10673343 75000.00 LITERATA 23567831 37500.00 WILCO 111000023 80000.00 HEAROWITZ 31896154 33000.00 TYRO 19893456 20000.00 KAHALLY 29661234 20000.00 PAPAZEUS 22887770 100000.00 PAPAZEUS 22887770 90000.00 - 1 -
Edit Commas
In this example, the EDIT command requests display of the SALARY-AMOUNT-0420 field with commas and dollar signs:
edit salary-amount-0420 commas $ ! display EMPLOYEE/EMPOSITION REPORT mm/dd/yy EMP-LAST-NAME-0415 SS-NUMBER-0415 SALARY-AMOUNT-0420 LINGER 92345812 $38,500.00 TERNER 45672222 $13,000.00 LINGER 19556712 $42,500.00 LINGER 19556712 $38,000.00 PENMAN 14593186 $39,000.00 LINGER 10673343 $85,000.00 LINGER 10673343 $75,000.00 LITERATA 23567831 $37,500.00 WILCO 111000023 $80,000.00 HEAROWITZ 31896154 $33,000.00 TYRO 19893456 $20,000.00 KAHALLY 29661234 $20,000.00 PAPAZEUS 22887770 $100,000.00 PAPAZEUS 22887770 $90,000.00 - 1 -
Edit External Picture
This example shows EDIT describing an external picture for the JOB-ID-0440 field that specifies an insertion character:
edit ss-number-0415 pic '999-99-9999' ! display EMPLOYEE/EMPOSITION REPORT mm/dd/yy EMP-LAST-NAME-0415 SS-NUMBER-0415 SALARY-AMOUNT-0420 LINGER 092-34-5812 $38,500.00 TERNER 045-67-2222 $13,000.00 LINGER 019-55-6712 $42,500.00 LINGER 019-55-6712 $38,000.00 PENMAN 014-59-3186 $39,000.00 LINGER 010-67-3343 $85,000.00 LINGER 010-67-3343 $75,000.00 LITERATA 023-56-7831 $37,500.00 WILCO 111-00-0023 $80,000.00 HEAROWITZ 031-89-6154 $33,000.00 TYRO 019-89-3456 $20,000.00 KAHALLY 029-66-1234 $20,000.00 PAPAZEUS 022-88-7770 $100,000.00 PAPAZEUS 022-88-7770 $90,000.00 - 1 -
|
Copyright © 2013 CA.
All rights reserved.
|
|