Previous Topic: Edit Parameters— OverviewNext Topic: Coding Examples of Output Definition Parameters


Edit Parameters

For more information, see:

Edit Parameters

Purpose

Defines the output lines for a report.

Syntax

      Col
      2
      ▼
►►─── nn ──┬┬─ 4 ─┬┬─ line column spacing-code ───────────────────────────────►
           │└─ H ─┘│
           ├┬─ 5 ─┬┤
           │└─ D ─┘│
           └┬─ 6 ─┬┘
            └─ S ─┘
 ►─┬─ literal ───────────────┬─┬─────────────────┬─┬─────────────────────┬────►
   ├─ field-name-expression ─┤ └ SZ = field-size ┘ └ DP = decimal-places ┘
   ├─ PAGE ──────────────────┤
   └─ DATE ──────────────────┘

 ►─┬────────────────────────────┬─┬────────────────────────────────┬──────────►
   └─ COLUMN = column-position ─┘ └─ format-code ─┬───────────────┬┘
                                                  └─ 'edit-mask' ─┘

 ►─┬──────────────────────────┬───────────────────────────────────────────────►◄
   ├─ HR ─────────────────────┤
   ├─ HF ─────────────────────┤
   │      ┌─────────────────┐ │
   └─ HH ─▼─ 'auto-header' ─┴─┘

Expansion of Field-name-expression

►►──── field-name ──┬─────────────────────────┬───────────────────────────────►◄
                    ├─ .subscript-value ──────┤
                    └─ .subscript-field-name ─┘

Syntax Rules

nn

Identifies the report associated with the edit parameter. Nn must be a 2-digit number in the range 00 through 99 and must be coded starting in column 2.

4

Indicates that the edit parameter defines an output field on a header line; alternatively, H (header) can be used to identify a header parameter.

Must be coded in column 4.

Report headers can be specified either on type 4 edit parameters or by using the auto-header capabilities of CA Culprit. Headers specified on type 4 edit parameters are printed above headers specified as auto-headers; auto-headers are discussed later in this chapter under syntax rules for HH, HR, and HF.

5

Indicates that the edit parameter defines an output field on a detail line; alternatively, D (detail) can be used to identify a detail parameter.

Must be coded in column 4.

6

Indicates that the edit parameter defines an output field on a total line; alternatively, S (summary) can be used to identify a total parameter.

Must be coded in column 4.

line

Specifies an edit line. It must be a single digit in the range 1 through 8 and must be coded in column 5.

Note: The total of the number of lines specified for type 4 edit parameters and the number of auto-header literals coded on a type 5 or type 6 edit parameter must not exceed 8. If the total number of equals 8, type 4 edit parameters must specify line sequentially, starting with 1.

column

Specifies the location of the output field on the output line. Column must be a 4-character value coded in columns 6 through 9. Column can specify either an absolute column position on the output line or a relative column position on the output line, as follows:

A column position of 0 can be specified for one or more numeric output fields coded on type 5 edit parameters. These fields are not output in the detail lines for the report. CA Culprit totals the values of the nonprinted fields; the field totals can be used during the output phase in type 8 process parameters and type 6 edit parameters.

Output fields must not overlap on the output record, with the exception of a trailing negative sign edit character. If the first character of an output field overlaps the negative sign that follows the previous output field, CA Culprit performs the following tasks:

spacing-code

Specifies the number of lines skipped before the edit line is output. Spacing-code is a single character that must be coded in column 10. Valid space codes include any standard ASA character, as listed in the following table.

If a single edit line definition contains more than one type of space code, spacing is determined by the value of the last nonblank code encountered (that is, the space code on the edit line definition that has the highest column number).

When a space code of 1 appears on a type 5 or type 6 edit parameter, the associated detail or total line prints on a new page. Title and header lines do not print, unless this feature was requested at installation.

Spacing-code Value

Spacing Performed

Omitted

Single space

0

Double space

-

Triple space

1 through 9

Skip to channel 1 through 9

A,B,C

Skip to channel 10(A), 11(B), or 12(C)

+

No spacing (overprint on the same line)

V

Select card into pocket 1 (P1); applies to card output only

W

Select card into pocket 2 (P2); applies to card output only

literal/field-name-expression/PAGE/DATE

Specifies an output field.

literal

Specifies an alphanumeric or hexadecimal literal:

field-name-expression

Specifies an input field defined on a REC parameter or a work field defined on a work field parameter.

See expansion of field-name-expression below.

PAGE

A reserved word that can appear only on type 4 edit or type 8 process parameters (see Error! Reference source not found.).

When PAGE is coded on a type 4 edit parameter, CA Culprit outputs a 1- to 6-digit page number with leading zeros suppressed. As each new page begins, the value of PAGE increases by 1. Users can reset this value in type 8 procedure logic, as explained in Process Parameters.

PAGE can be defined for only one output field in a report. Generally, it is used when no title parameter is coded for a report. If PAGE is coded for a report that includes a title parameter, the page number is not output on the title line.

DATE

A reserved word that can appear only on type 4 edit parameters. When DATE is specified, an 8-character date is output in mm/dd/yy (American), dd/mm/yy (European), or yy/mm/dd (Canadian) format. The date format and the inclusion of the system time are governed by PROFILE parameter options DS= and TS=.

SZ = field-size

Specifies the number of alphanumeric characters or digits printed in the output field. If this keyword expression is not specified on a type 4 or type 5 edit parameter, the default output size is determined by the field and data type, as indicated in :tref refid=outsize..

If totals print automatically (that is, type 6 edit parameters are not coded for the report), the default output size is the size specified for the associated field on a type 5 edit parameter. If type 6 edit parameters are specified, the default output size is the size indicated in the table that follows.

The following considerations apply to field-size for numeric and alphanumeric fields:

Field

Data Type

Code

Default Size

Input

Alphanumeric

Omitted

Input size

 

Binary

1

Three times input size

 

Zoned decimal

2

Input size

 

Signed packed decimal

3

Two times input size minus 1

 

Unsigned packed decimal

4

Two times input size

 

Bit (data type is 5)

5

Three digits

Work

Alphanumeric

 

Work field size

 

Numeric with no decimal point specification and containing 15 digits or less

 

15 digits

 

Numeric with a decimal point specification or with an initial value containing more than 15 digits

 

31 digits

Note: The size reflects only the number of digits; CA-Culprit makes no adjustments for edit characters in output size specifications.

DP = decimal-places

Specifies the number of digits to the right of the decimal point in a numeric output field. Decimal-place must be in the range 0 to 14. If DP=0 is specified, no decimal point or decimal positions are output.

Consider the following when coding a DP= keyword expression on an edit parameter:

Sample decimal specifications appear in the following table.

Note: If the PROFILE parameter option RELEASE=5 is in effect, the default for decimal-places is 2 for all numeric fields unless a DP= keyword expression is specified on a REC, work field, or edit parameter for the field.

REC Parameter Specification DP=

Edit Parameter Specification DP=

Result

Not specified

Not specified

///123,456

0

Not specified

///123,456

Not specified

1

///12,345.6

3

Not specified

///123.456

3

2

//1,234.56

Note: In this table, the field size equals 8 bytes. Blanks are shown as slashes (/)

COLUMN = column-position

Specifies the absolute position of an output field beyond column position 9999. Column-position is an integer in the range 10,000 to 32,760.

The following coding considerations apply:

format-code edit-mask

Specifies format options for numeric output fields, as follows:

Valid Format Codes for Printed Output Fields

Code

Editing Operation Performed

Omitted

Leading zeros are suppressed; commas are inserted.

F*

F* replaces leading zeros by asterisks except for decimal positions. The last digit is followed by an asterisk, unless the field value is negative. Commas are inserted. This format option is used primarily for check protection.

F0

F0 suppresses leading zeros and omits commas. If the value is negative, a trailing minus sign is output.

Fn

Fn suppresses leading zeros except for the last n digits, where n is a number in the range 1 through 9. Commas are inserted. If the value is negative, a trailing minus sign is output. This option outputs a specified minimum number of zeros when the value is 0. If this format code is specified with a DP= keyword expression, the value of n should be equal to or greater than the number of decimal places.

F$

F$ suppresses leading zeros except for decimal positions or, if there are no decimal positions, the last digit. Commas are inserted. A floating dollar sign is inserted before the first number output. If the value is negative, a trailing minus sign is output.

FN

FN outputs leading zeros and omits commas for the default length of the field. If the value is negative, a trailing minus sign is output. A decimal point is output, if specified.

FC

FC suppresses leading zeros except for decimal positions or, if no decimal positions are specified, the last digit. Commas are inserted. If the value is negative, it is enclosed in parentheses. The left parenthesis is output immediately before the first digit output.

F-

F- suppresses leading zeros except for decimal positions or, if no decimal positions are specified, the last digit. Commas are inserted. If the value is negative, a minus sign is output before the first digit output.

FF

FF suppresses leading zeros except for decimal positions or, if no decimal positions are specified, the last digit. Commas are omitted. If the value is negative, a minus sign is output before the first digit output.

FD

FD edits the field in date format: mm/dd/yy. The field size is assumed to be six digits. Keyword expressions SZ= and DP= are invalid on an edit parameter that specifies format code FD. The accumulated total of a field that specifies this format code on a type 5 edit parameter does not appear in a total line that is generated automatically.

FS

FS edits the field in social security number format: nnn-nn-nnnn. The field size is assumed to be nine digits. The keyword expression DP= is invalid on an edit parameter that specifies format code FS. The accumulated total of a field that specifies this format code on a type 5 edit parameter does not appear in a total line that is generated automatically.

FM

FM edits the field as specified by the associated user edit mask. A user-defined edit mask must follow. Keyword expressions SZ= and DP= are invalid on an edit parameter that specifies format code FM. The accumulated total of a field that specifies this format code on a type 5 edit parameter does not appear in a total line that is generated automatically.

FR

FR reverses the contents of an alphanumeric text string. This is useful for languages that require the reader to read right to left.

Valid Format Codes for Nonprinted Output Fields

Code

Description of Editing

FB

FB converts an integer field value to binary output. The integer field value must be a number in the range -2,147,483,648 through 2,147,483,647. The output field size is 1 to 4 bytes; 4 bytes is the default. Any necessary truncation or zero-filling occurs on the left.

FU

FU converts a numeric field value to a single precision floating point value. The output field size is 4 bytes. Keyword expressions SZ= and DP= are invalid on an edit parameter that specifies format code FU. Format code FU is used primarily in scientific applications.

FW

FW converts a numeric field value to a double precision floating point value. The output field size is 8 bytes. Keyword expressions SZ= and DP= are invalid on an edit parameter that specifies format code FW. Format code FW is used primarily in scientific applications.

FP

FP converts the output field value into a signed packed decimal number. This format code should be specified for nonprinted output; when used with printed output, the results are unpredictable. The maximum field size with format code FP is 16 bytes.

FZ

FZ converts the output field value into a zoned decimal number. Negative values are output with an 11-zone punch over the last digit. This format code should be specified for nonprinted output; when used with printed output, but the sign punch either suppresses printing of the last digit (if it is 0) or prints the last digit as an alphabetic character.

Examples of Format Edit Specifications for Printed Output Fields

Format Edit Code

+123456

0

-6315

F*

***123,456*

***********

*****6,315-

F0

//123456

////////

////6315-

F2

///123,456

////////00

/////6,315-

FN

00123456

00000000

00006315-

F$

//$123,456

////////$0

////$6,315-

FC

///123,456

/////////0

////(6,315)

F-

///123,456

/////////0

////-6,315

FF

//123456

///////.0

///-6315

Note: In this table, the field size equals 8 bytes. Blanks are shown as slashes (/).

edit-mask

Describes the size and format for a numeric output field. It applies only to fields defined with format code FM. Edit-mask is a 1- to 64-character expression, enclosed in single quotation marks, that describes the field size and format, the number of decimal places, and any characters to be inserted into the value.

Selected alphanumeric characters have unique meanings when used in an edit mask; these characters are described below:

Each edit mask must begin with a digit indicator, a zero-suppression character, or a decimal point indicator; all other types of characters are optional. Sample edit masks are shown in the following table.

Indicator

User Mask

Field Value

Printed Result

Digit

'999' or 'ZZZ'

+123

123

 

'9999'

 

0123

 

'ZZZZ'

 

/123

 

'99' or 'ZZ'

 

23

 

'ZZZ99'

 

//123

 

'9999'

-123

0123

Decimal point

'9.99'

+123

1.23

 

'Z.999'

 

/.123

Insertion character

'99A99B99C'

+123

00A01B23

 

'99Z99'

 

01Z23

Negative value

'9.99-'

+123

1.23

 

 

-123

1.23-

 

'ZZ.99RZ'

+123

/1.23//

 

 

-123

/1.23RZ

HR/HF/HH auto-header

Specifies the origin of automatically generated headers. If auto-headers are not specified, all headers printed are from user-coded type 4 edit parameters.

Note 1: An auto-header must not be coded on a type 6 edit parameter unless a totals-only report is defined. Headers can be defined on either a type 5 or type 6 edit parameter for a totals-only report, but not on both.

Note 2: An auto-header must not be coded on a type 4 edit parameter.

HR

Indicates that the source of auto-headers is the REC parameter that defines the associated field. If HR is not specified, any auto-header literals defined on the REC parameter are ignored.

HF

Indicates that the source of the auto-header is the name of the field or literal defined on the edit parameter. For example, if the field name is ACCTNO, this name is used as the header. If the field is subscripted, the base field name (that is, the field name without the subscript value) is used as the header. If literal is specified, the literal name acts as the header.

HH auto-header

Indicates that an auto-header immediately follows HH on a type 5 or type 6 edit parameter.

The following considerations apply to coding auto-header:

Auto headers appear at the top of each report page, below the title line (if any), and below headers generated by type 4 edit parameters (if any). Each auto-header is centered over the field column. If the auto-header contains more than one literal, the literals are stacked vertically to form a multiline heading.

Auto headers should be associated with a single edit line. If this is not possible, CA Culprit generates separate header lines for each edit line number with an associated header-origin code, starting with the lowest line number.

Examples

Sample edit parameters for header lines, detail lines, and total lines are shown and described below.

Example 1: Header Lines

01410040-'CURRENT BALANCE'
01410062 'DATE'

Header line 1 contains two output fields; both are literals. CURRENT BALANCE prints beginning in column number 40 and DATE prints beginning in column 62. The line is printed at the top of each new page after the title, if one is specified. Two blank lines separate the title from the header, as established by the space code - (hyphen).

An alternative way of coding the same header line appears below:

01H10040-'CURRENT BALANCE       DATE'

Example 2: Header Lines

3341*010     'BRANCH'
3342*010     BRANCH

Report 33 contains two header lines; the literal BRANCH prints in the relative column identified by 10; the branch name prints in the same relative column, directly below the literal. The field BRANCH must be specified on either a SORT parameter or in a HEAD instruction.

Example 3: Detail Lines

095100120 CUST-NAME            SZ=15
09520012  CUST-AMT-SALES       F$
09520035  CUST-NUM-SALES       F1

The body of Report 09 contains a listing of customer names, the amount of sales, and the number of sale transactions. The customer's name prints for 15 spaces on the first detail line, starting in column number 12. A blank line is output before the name is output.

The amount of sales prints directly below the name, beginning in column 12. CUST-NUM-SALES prints on the same line as CUST-AMT-SALES, starting in column 60. The sizes of these two output fields are the default values determined by the definitions of the fields. Format codes are used to edit the printed output.

CA Culprit automatically totals and prints the totals of CUST-AMT-SALES and CUST-NUM-SALES. Printing can be suppressed either by coding type 6 edit parameters or by defining a details-only report on the OUTPUT parameter.

Example 4: Detail Lines

 23510000 COUNT
 2351*010 CUST-NAME        SZ=15     HR
 2351*030 CUST-AMT-SALES   FM '$ZZ,ZZ9.99CR'
*                                    HH 'AMOUNT OF' 'SALES'
 2351*020 CUST-NUM-SALES   FM 'ZZ9'  HH ' ','NUMBER OF','SALES'
 2351*040 SALE-DATE        FD        HF

Four output fields are printed in relative column positions 010 through 040 on one detail line. The four columns are spaced evenly across the page in ascending order.

A column heading is specified for each output field. The auto-header for CUST-AMT-SALES, coded on a continuation line, contains two literals; therefore, a two-line header will appear over relative column 2. A blank line automatically prints between the column headers and first detail line because fewer than eight auto-header lines are specified.

Edit masks are used in this example to format the printed output fields. Although CUST-AMT-SALES, CUST-NUM-SALES, and SALE-DATE are numeric fields, the column totals of these fields are not automatically printed because format codes FD and FM are specified. The output field COUNT is not printed on a detail line because the type 5 edit parameter specifies 0 for a column number. However, the accumulated value of COUNT is available for use during the output phase.

Example 5: Total Lines

2361*020  CUST-NUM-SALES   FM 'ZZZ9'
2361*030  CUST-AMT-SALES   FM '$ZZZ,ZZZ,ZZ9.99CR'
23620001  'TOTAL CUSTOMER VISITS'
23620023  COUNT  SZ=6  F1

These edit parameters define total lines for the previous example. Total lines are not automatically output because type 6 edit parameters are defined. Instead, the output of total lines can be controlled with type 8 procedure logic.

Edit masks are specified again for CUST-NUM-SALES and CUST-AMT-SALES. The size of the output fields is larger to accommodate total values.

Total line 1 is coded with relative column numbers and total line 2 with absolute column numbers. A literal prints starting in column 1 of the second total line. The total value of COUNT, accumulated as a nonprinted field on a type 5 edit parameter, prints starting in column 23 of the second total line.