5 World Writer Setup

This chapter contains these topics:

5.1 About World Writer Setup

World Writer consists of a series of setup screens used to enter the version specifications.

If you are creating a brand new version, the setup screens are presented in the order that they should be completed.

If you are modifying or copying an existing version, the Selective Change Prompt window is presented and you can choose only those screens that need changing or reviewing.

As you go through the setup screens, press Enter to capture your changes and review the screen. If you make more changes, press Enter again to update with the changes. When you are ready for the next step, press Enter once again to advance to the next screen.

5.2 Assigning Version Titles and Files

Use Version Titles & Files to assign the version name and title, the report title and to specify the files to be used in the query.

Figure 5-1 Version Title and Files screen

Description of Figure 5-1 follows
Description of "Figure 5-1 Version Title and Files screen"

Field Explanation
Group You cannot enter information into this field. The Group ID defaults from either the Versions List or from the version that was copied.
Version A ten- character code identifying an individual query within a given query group (see QRYG). It is similar in function to DREAM Writer's Screen ID, but in World Writer this field is user-defined.
Version Title A description that further describes the nature of the query. Both the Version and Title also display on the Versions List. The version title is different from the report title.
Report Title The title that displays at the top of the report. It can include up to three lines with 40 characters each. The lines are automatically centered on the report.

After you enter the Version and Report Title, press Enter and specify file names.

File Name The name of a database file from which data is retrieved for the version. The first file listed is considered the primary file.
Description You cannot enter information into this field. The file name displays after you press Enter.

Note:

Press F4 to display more details in the fold area.

Figure 5-2 Version Title and Files (Details) screen

Description of Figure 5-2 follows
Description of "Figure 5-2 Version Title and Files (Details) screen"

Field Explanation
Library The name of the library that contains the specified query file. Defaults to *LIBL.
Member The name of the file member to use for the version. You can select only one member. The default is to query the first (*FIRST) member in the file. Most data files contain only one member.
File ID Identifies all the fields in a file if more than one file is selected in a query. In the case of duplicate field names in two or more files, the file ID is used to determine which occurrence of the field is being referred.

The query program automatically assigns file IDs sequentially.

JD Edwards World Indicates whether a file follows the JD Edwards World standards for field naming. The default is Y. This assumes that all the fields exist in Data Dictionary. If N is specified World Writer uses the external File Field Descriptions.

5.2.1 Options

9 - Deletes a previously selected file.

5.2.2 Function Keys

F5 - Exit to Printer Overrides

F8 - Exit to the File Relations Join Criteria screen; only available when two or more files are indicated.

5.3 Understanding Joining Files

A file join allows files that share common elements to be connected so that data from two or more files can be used. The files are joined by defining the relationship between one or more fields in each file.

When files are joined, the system compares each record in one file to each record in the other file(s). The records are tested against the join and data selection criteria. If the record passes the test, it will appear on the output.

5.3.1 Joining

World Writer retrieves records where "Matching" records are found in each file, based on the joined fields.

The types of joins to obtain either "Matched with Primary file" or "Unmatched with Primary file" are not available with World Writer.

Typically, matching field names from each file are joined. For example: The join between F060116 and F0101 is the Address Book Number field, AN8. If an Address Book Number exists in F0101 but there is no matching number in F060116, then that number does not appear in the output.

5.3.2 Indirect Join

Occasionally, you may need data from two files that do not have like fields. You may need a third file that has fields common with both.

For example, there may be no direct join fields between F0101 and F0016 (Generic Text). F00163 (Generic Text Key Index) has fields common to F0101 and F0016. Even though no fields from F00163 are being used elsewhere in the report setup, F00163 must be included for the purpose of joining the other two files.

5.3.3 Soft Join

The World Writer File Join screen allows fields with the same data type to be joined, such as alpha to alpha and numeric to numeric. In some instances, you may need to perform a Soft Join. This is joining two files that have like data in fields but one field is alpha and the other field is numeric.

For example, you may join the Address Book Number (AN8), a numeric field, to the Subledger field (SBL), an alpha field.

See Appendix B, "Soft Join."

5.3.4 Guidelines

The following list details some helpful guidelines and information:

  • Only join files when necessary. World Writer's presumptive join feature might provide the fields you need.

  • Look for a joined logical file. The join criteria are predefined and eliminate the need to include more than one file. Example: F0101JC is a joined logical file using F0101, F0116 and F0401. Join fields that contain identical data. See Appendix A, "Joined Logical Files" for a list of joined logical files available for use in World Writer.

  • The most effective way to join files is by the fields that are unique keys to the files. One way to find the unique keys is by viewing the file through Hidden Selection 40. Key fields are noted with K01, K02 etc. between the file field name and the description. If no keys are shown in HS 40, view a logical file, such as F4211LA

  • At least one field must be joined and some files will require more than one field to be joined to achieve a one-to-one relationship.

There are two direct join methods:

  • File Relations - Match Fields

  • File Relations - Enter Fields.

These screens are only available when two or more files have been specified on Version Title & Files.

5.4 Using File Relations - Match Fields

This screen allows you to search for matching fields in each file and assign matching sequence numbers to complete the join.

This screen is only available when two or more files are listed on Version Title & Files.

The screen is split into two sections:

  • Fields from the first file are listed on the top half of the screen.

  • Fields from the second file display on the bottom half of the screen.

To view all the fields, position the cursor in the appropriate portion of screen and use page down or roll.

Figure 5-3 File Relations - Match Fields screen

Description of Figure 5-3 follows
Description of "Figure 5-3 File Relations - Match Fields screen"

Field Explanation
From File To File The names of the database files specified on the Version Title & Files screen.
Description The field description. If displayed in order of field name, the name of the field is appended after the description.
Seq Links the sequenced field in the first file to the field with the same sequence number in the second file. Use 1, 2, and so on, for each field needed in sequence.
Relation Describes the test to perform between two fields. This should always be EQ (equal), which is the default.

5.4.1 Function Keys

F6 - Display the next file on the top or bottom half of the screen, based on the cursor position.

F8 - Exit to File Relations - Enter Fields. A fast path method of specifying the join relations.

F14 - Toggle between the three different sort options for fields on the screen: Field position, field name, and field description. File affected is based on cursor position.

5.4.2 Using File Relations - Enter Fields

If the field data item names are known, use this screen to enter the matching fields. This is a short-cut method.

This screen is also a good place to review the join criteria for all files.

Note:

This screen is only available when two or more files are listed on Version Title & Files.

Figure 5-4 File Relations - Enter Fields screen

Description of Figure 5-4 follows
Description of "Figure 5-4 File Relations - Enter Fields screen"

Field Explanation
From Field The name of the data field from one of the specified files. If possible, start with a field from the 1st file
File ID The file ID associated with the From Field. You may skip this field. When enter is pressed, the program will locate the first File ID found that matches the From Field name and populate this field. If identical field names exist in the files, you should determine the correct File ID and enter it.
Relation The system displays a default value of EQ. Leave this default.
To Field The name of the data field from another file to link to the From Field. The From and To Fields should have identical data and must have the same characteristics, i.e. alpha vs. numeric.
File ID The file ID associated with the To Field. You may skip this field. When enter is pressed, the program will locate the first File ID found that matches the From Field name and populate this field. If identical field names exist in the files, you should determine the correct File ID and enter it.

5.4.3 Function Keys

F8 - Exit to File Relations - Match Fields.

5.5 Using Additional Parameters

Use the Additional Parameters screen to group together many of the options for processing the query at runtime, such as:

  • Default column and line spacing

  • Prompt for data selection

  • Detail or Totals Only report

  • Report or output to a file

  • Batch and job queue overrides

Figure 5-5 Additional Parameters screen

Description of Figure 5-5 follows
Description of "Figure 5-5 Additional Parameters screen"

Field Explanation
User Exclusive (0/1/2/3) Allows you to restrict user access for a report version.

For JD Edwards World, the valid values are:

0 – No security. Anyone can change, copy, delete, or run the version. This is the default when adding a new version.

1 – Medium security. Only the "last modified by" user can change or delete the version. Anyone can copy or run the version. This is how the JD Edwards World DEMO versions are delivered.

2 – Medium-to-full security. Only the "last modified by" user can change, delete, or run the version. Anyone can copy the version.

3 – Full security. Only the "last modified by" user can change, delete, copy, or run it.

4 – Medium security - extended. Only the "last modified by" user can change or delete the version. Anyone can copy or run the version.

Print Cover Page (Y/N) A code that controls whether to print the cover page for the version. The cover page shows setup criteria.

Y – Print cover page

N – Do not print cover page

Hold on Job Queue (Y/N) A code used to indicate whether to hold the submitted job in the job queue. Values are:

Y – Hold in job queue

N – Job will process through the job queue

Batch Job Queue The computer waiting line that particular job passes through. If blank, it defaults to the job queue specified in the user's job description.
Prompt for Data Selections A code that displays the Data Selection screen when a version is submitted. This allows users access to modify the record selection criteria without changing the basic structure of the version. This also ensures that record selection is reviewed and/or changed before the version is submitted.

Y – Display Data Selection at runtime.

N – Version is submitted without displaying Data Selection.

Query Detail (or Totals Only) A code indicating whether to print detail lines on a report, or just the total lines.

D – Print detail and total lines

T – Print totals only

Default Line Spacing The number of lines to advance before printing the next detail line. When a print line is wrapped, the wrapped lines are all single-spaced.

The number of lines to space before a total line can be changed when defining the total line on Data Sort & Totaling.

Default Column Spacing The number of blank spaces before the next column prints. The default spacing can be overridden on a field-by-field basis on Output Field Specifications.
Maximum Form Width Indicates the width of the form on which the requested report is to be printed.

The range of values is 1 through 378, with a default of 132. If the width of the report columns is greater that this number, either the remaining columns will wrap to the next line or be truncated, based on the Line Wrap setting (see below). Use the Report Layout F13 to view the results of changing this field.

Line Wrap (Y/N) Allows line wrapping caused by selecting more output fields than will fit on a print line.

Y – If the width of the report columns is greater that the Maximum Form Width, then the remaining fields wrap to the next print line(s).

N – Line wrapping will not occur and remaining fields are truncated.

Note: You must specify Y to print all Summary Functions.

One Line per Page (Y/N) Prints each data record on a separate page when this option is set to Y.
Total Level Text in Header Used with software that must detect a change in data in order to perform a function, usually involving a page skip. If this field is set to Y, the text from Total Level Hdr field in Data Sort & Totaling will print above the column headings. Only one total level should contain Hdr text if this feature is in use.

Y prints Total Header text above column headings. The default is No.

Maximum records to query Indicates the maximum number of records to fetch from the database and print. Any selected records after this count are not output. The default value is *NOMAX (no maximum). The value specified will not exceed the number of records specified for the Create Physical File command (CRTPF) or maximum spooled output records for printer file QSYSPRT.

Use this feature to verify the print format of a new query or when a sample of the data is desired.

Print Queue A designation of a specific print queue, such as QPRINT.

If left blank, this field defaults to the print queue specified in your user profile.

Output Media Destination of the version output. The following codes are valid:

P – Printed Output

F – Disk File

X – Rydex Fax Output. Print output is routed to output queue QFAX for use with FAX/400 supported by IBM.

Packed to Zoned Flag used to assist the user in preparing files that contain numeric data and are intended for transfer to a PC or other non AS/400 system. Enter a "1" to cause World Writer to convert all packed fields to zoned decimal when creating a file. This flag has no impact on reports.
Output File Name of the output file to be created. Specify F in the Output Media field. The file does not need to be created on the iSeries; it will be created for you when the version is submitted and completes normally.
Output Library The name of the output library where the file will be created. Specify F in the Output Media field. This library must already exist on the iSeries.

5.5.1 Function Keys

F6 - Exit to the Batch PC Export Parameters

F13 - Display Report Layout.

5.6 Using Field Selection

The Field Selection List indicates what fields to use for printing, data selection, sort, and total functions. This step serves as a type of scratch pad to select fields for subsequent steps. You can use the Version Layout Worksheet (see Chapter 4, "Finding Files and Fields") you completed when planning your report to help you on this screen.

All fields in each selected file are listed. Scroll Up and Down to view all the fields. If two or more files have been specified on the Version Title & Files screen, you can also use the Skip to File field to jump to a specific file.

To select fields

On Field Selection List

Figure 5-6 Field Selection List screen

Description of Figure 5-6 follows
Description of "Figure 5-6 Field Selection List screen"

  1. Choose one of the following methods for selecting fields:

    • Enter X in the appropriate column or columns (Print, Select On, Sort By, and so on) to select the fields and their function.

    • Enter 1 in the Option field to select the field for Print, Select On and Sort By. The field will appear on all three setup screens, but can easily be removed if not needed.

    Note:

    This is the easier method, particularly if the exact specifications have not been pre-defined (
  2. If creating a new version, review the fields "tagged" on the Field Selection List that display on each subsequent screen.

  3. If modifying or copying a version, choose F15 on each subsequent screen to display the "tagged fields."

Field Explanation
Description Represents the field text specified in the Data Dictionary.
Print Displays on the Output Field Specifications screen. (V82104) when selected.
Select On Displays on the Data Selection Screen (V82107) when selected.
Sort By Displays on the Data Sort and Totaling Screen (V82108) when selected
Sum Sum or total the values in this field. This is only valid for numeric fields.
Avg Calculates the average value of this field. This is only valid for numeric fields.
Min The minimum or lowest value of this field. Negative numbers are considered lower than zero or any positive number. Character fields are compared according to the standard EBCDIC collating sequence.
Max The maximum or highest value of this field. Negative numbers are considered lower than zero or any positive number. Character fields are compared according to the standard EBCDIC collating sequence.
Cnt Count and print the number of records printed. In World Writer the count function is not a distinct count. This value will be the same no matter what field is selected.
Field Name The data item name of the field.

Caution:

The Field Selection list is valid only for the current session. Once you complete setup steps or press F3 to exit, the Field Selection list is deleted. You can create a new list if you return to add fields to this version later.

5.6.1 Presumptive Join Fields

Presumptive Join Fields are additional fields made available for printing purposes within the World Writer application. They contain data related to a field that resides in the file you are using in your World Writer version, but the presumptive join fields are stored in a different file. Without the use of presumptive join fields, you would be required to join both files in order to retrieve the related information.

On the Field Selection List screen, presumptive join fields are named with the file field name plus a 2-digit extension. The fields are indented directly below the file fields. These fields are only available for print.

For example:

  • GLKCO is a file field.

  • GLKCO01 is a presumptive join field that contains the company name.

  • GLDCT is a file field.

  • GLDCT01 and GLDCT02 are presumptive join fields with the description lines for document type.

5.7 Using Output Field Specifications

The Output Field Specifications screen is where most of the report design and layout functions are done.

You can:

  • Sequence the order of the printed columns.

  • Adjust the size of the columns.

  • Wrap lines.

  • Change the column headings.

  • Adjust spacing.

  • Perform several editing and display functions.

The Output Field Specification screen is also the starting point in creating calculated fields.

Figure 5-7 Output Field Specifications screen

Description of Figure 5-7 follows
Description of "Figure 5-7 Output Field Specifications screen"

Field Explanation
Total Width Width calculated for you by adding together the length of fields and column spacing.
Seq No A number that defines the relative order of the output fields. For example, a sequence number of 10 will come before 20, and so on.

Screen-specific information

Fields that have a Print When code of N (never), do not affect the print sequence and therefore can have any sequence number.

Description Represents the field text specified in the Data Dictionary.
Size Print size of the field. This can be reduced from the actual size of the field to allow for truncating the printed output or enlarged to allow for numeric editing characters.

The actual number of characters taken up for printing is the larger of either the output size or the column heading.

W L (Wrap Line) Wraps this field down to the next print line. Enter Y to activate this wrap feature. Line spacing is always single-spaced.

This is used to make this line of data appear directly below the data in the prior line. Take care to properly calculate the number of spaces to enter in the Col Sp (Column Spacing) field.

P W (Print When) Code identifying when to print a field value. Valid codes are:

A – Always print the value (this is the default).

C – Print each time the value changes.

N – Never print the value. Used for derived or sort fields that you do not want printed.

Col Sp (Column Spacing) Number of spaces before a column will print. The default for *DF is determined from the value entered on Additional Parameters (V82109) Default Column Spacing. Use with the Wrap Line feature to align columns.
Sup Hdg (Suppress Heading) Suppresses Heading. Enter a Y to Suppress the Column Headings for this field. This is typically used with the Wrap Line feature.
Edt Cde Defaults from Data Dictionary. Use Field Sensitive Helps (F1) to determine how numeric data is formatted when printed, such as:
  • Whether a separator character prints

  • Whether zero or blank prints when data = 0

  • The character and position of negative numbers

Prt Dec The number of decimal positions to show in the edited print field.
Num Scl The scale code is used to truncate quantity fields. This allows you to show a quantity expressed in 100s, or 1,000s and so on.

Valid codes are:

0 – No scaling. This is the default.

1 – Divide by 10.

2 – Divide by 100.

3 – Divide by 1,000.

4 – Divide by 10,000.

5 – Divide by 100,000.

6 – Divide by 1,000,000.

Output Field The name of the field in the file.

Note:

Press F4 to display more details in the fold area.

Figure 5-8 Output Field Specifications (Details) screen

Description of Figure 5-8 follows
Description of "Figure 5-8 Output Field Specifications (Details) screen"

Field Description
Chain Field The name of the field for presumptive join fields used to retrieve a related description field.
Server File The name of the file for presumptive join fields used to retrieve a related description field.
From File File ID assigned when files are specified in Version Title & Files. If blank, this is either a presumptive join field or a calculated field.

Note:

You must press Enter once to update the Total Width field and enable the F13 key for Report Layout. Whenever you make a change to the Output Field Specifications, you may impact the Total Width. A highlighted field Description indicates where line wrapping occurs.

5.7.1 Options

1 - Work with Calculation

5 - Work with Field Detail Specifications

7 - Query File Update. Available when one file specified on Version Title & Files. See Chapter 9, "About Updating Files" for details.

9 - Delete a field. You cannot delete a field if it is being used on Data Sort & Totaling.

5.7.2 Function Keys

F13 - Displays the Report Layout.

F15 - Displays fields tagged on the Field Selection List. The tag list is active only for the current session.

F16 - Displays all fields in the selected files.

F18 - Data Field Update. Available when one file specified on Version Title & Files. See Chapter 9, "About Updating Files" for details.

5.7.3 About Presumptive Join Fields

Presumptive Join Fields are additional fields made available for printing purposes within the World Writer application. They contain data related to a field that resides in the file you are using in your World Writer version, but the presumptive join fields are stored in a different file. Without the use of presumptive join fields, you would be required to join both files in order to retrieve the related information.

On the Output Field Specifications screen, presumptive join fields are named with the file field name plus a 2-digit extension. When no fields are sequenced or when F16 is pressed, these fields are located directly below the file field. Assign a sequence number to include these fields on the report.

For example:

  • GLKCO is a file field

  • GLKCO01 is a presumptive join field that contains the company name

  • GLDCT is a file field

  • GLDCT01 and GLDCT02 are presumptive join fields with the description lines for document type.

5.7.4 About Date Fields stored in the Julian format: CYYDDD

The Size and Edit Code of a Julian date field determines formatting. The examples in the table are shown in MM/DD/YY or MM/DD/YYYY format. Your System Values or User Preference will determine the order of month, day, year, and separator character used.

Size Edit Printed Output Output to File Data Type
8 W MM/DD/YY MM/DD/YY Alpha
8 Other than W Julian Julian Numeric
6 W MMDDYY MMDDYY Alpha
6 Other than W Julian Julian Numeric
10 W MM/DD/YYYY MM/DD/YYYY Alpha
10 Other than W Julian Julian Numeric

World Writer converts Julian date fields to Gregorian if the Edit Code is equal to W:

  • If the size is equal to or less than 6, no separator character is used.

  • If the size is greater than 8, the 4-digit year is used.

  • Sizes less than 6 or equal to 9 will truncate the data, both in printed output and output to file.

World Writer uses the Julian value if the Edit Code is other than W:

  • Printed output - Use an Edit Code that does not print a comma, such as C, D, L, or M.

  • Output to File - If the Size is less than 6, the version will end in a job log with the error "MCH1210 Receiver value too small to hold result." The size must be at least 6 if outputting to a physical file with an Edit Code other than W.

5.8 Using Field Detail Specifications

This screen is used primarily to modify the default column heading for file fields. For calculated field, you will want to add a column heading if the field is a printing field.

Some of the fields also appear on Output Field Specifications and can be modified from either screen.

On Output Field Specifications, type 5 in the Option Column next to the field you wish to work with.

Figure 5-9 Field Detail Specifications screen

Description of Figure 5-9 follows
Description of "Figure 5-9 Field Detail Specifications screen"

Field Explanation
Output Size Displays on Output Field Specifications and can be modified from either screen. See Chapter 5, "Using Output Field Specifications" for field descriptions.
Print Decimal Displays on Output Field Specifications and can be modified from either screen. See Chapter 5, "Using Output Field Specifications" for field descriptions.
Edit Code Displays on Output Field Specifications and can be modified from either screen. See Chapter 5, "Using Output Field Specifications" for field descriptions.
Numeric Scale Displays on Output Field Specifications and can be modified from either screen. See Chapter 5, "Using Output Field Specifications"for field descriptions.
Column Spacing Displays on Output Field Specifications and can be modified from either screen. See Chapter 5, "Using Output Field Specifications" for field descriptions.
Column Title Column headings defaulted from Data Dictionary. You can change the values on the screen. The three lines are 20 characters each and are automatically centered within the first 20 characters of the column.

Typically, the column heading should align with the size of the field. The third line should be reserved for dashes. If 20 dashes are entered, the line of dashes extends the full length of the column.

Field Size Actual field size, as defined in the file. This is for reference only; not input capable.
Actual Decimals Precision Provides the divide by factor for SQL. For file fields, this field can differ from the Print Decimal field. For calculated fields, this field must be the same as the Print Decimal field.
Date Format - From This field is obsolete.

5.9 Creating Calculated Fields

At some point while designing a World Writer report, you may need a field that contains information that is not available in the files selected for the query.

You can create a new field with a calculation that uses data from existing fields or literal text. When the version is submitted, the calculation is performed.

You can then place the new field on Output Field Specification, use it for selecting data and for sorting and totaling. You could also use it in another calculation.

Calculated fields can be used to update the value in another field. See Chapter 9, "About Updating Files."

To create a calculated field

Define the field attributes on the Output Field Specifications screen (V82104).

On Output Field Specifications

  1. Enter 1 in the following field on a blank row:

    • OP

  2. Assign the Sequence Number where the field should display, and enter a brief field description.

  3. Complete the following fields, as needed:

    • Output Size

    • Edit Code

    • Print Decimal

    • Numeric Scale

    • Column Spacing

    • Column Title

  4. Enter a unique name in the following field:

    • Field Name

  5. Press Enter. The Query Result Field Definition window displays.

Figure 5-10 Query Result Field Definition window

Description of Figure 5-10 follows
Description of "Figure 5-10 Query Result Field Definition window"

Field Explanation
Description Value defaults from Output Field Specifications. You can modify this field from this screen.
Size Value defaults from Output Field Specifications. You can modify this field from this screen. For example, you may determine that the size is not large enough to hold the result of calculation.
Print Decimal Value defaults from Output Field Specifications. You can modify this field from this screen.
Expression Used to enter the calculation. You can enter up to four lines with 60 characters each. Enter a single value or use as many operands and operators that will fit in the lines provided. You can split values and field name at the end of a line and continue it on the next line. In most cases, you do not need a space between fields, values, and operators

5.9.1 Operands for Calculations

The following chart shows the valid mathematical and special operators that can be used to create an expression. Operators can be used with file field names and/or literal values.

  • You can use literal values in place of field names, such as:

    • Alpha literal or constant values are entered in single quotes. 'ABC'

    • Numeric literal or constant values are entered without quotes. For example, 25.00.

  • You cannot use presumptive join fields in a calculation.

  • Operators can be entered in upper or lower case.

Operator Description Syntax
+ Add field values field1 + field2
- Subtract field values field1 - field2
* Multiply field values field1 * field2
/ Divide field values field1 / field2
Decimal Obtain a packed representation of a numeric value Decimal(field1 * field2,15,2)
Integer Obtain a whole number from a numeric value Integer(field)
Substr Obtain a sub-string from an alphanumeric value Substr(field,3,4)
Digits Convert a numeric value to alphanumeric Digits(field)
| | Concatenate or join together alphanumeric fields field1||'-'||field2

5.9.2 Examples of Calculations

The following are examples of calculations using the available operators.

Calculation Description
GBAN01 + GBAN02 + GBAN03 + GBAN04 + GBAN05 + GBAN06 Adds the Net Posting fields from F0902
YASAL * 2.5 Multiplies the Annual Salary from F060116 by 2.5
Integer(YADSI / 1000 + 5) Adds 5 to the year portion of the Original Start Date from F060116
GLMCU||'.'||GLOBJ||'.'||GLSUB Concatenates the Business Unit, Object and Subsidiary field into one field with a period between each value. 10.1110.BANK
Substr(YASSN,1,3)||'-'||substr(YASSN,4,2)||'-'||substr(YASSN,6,4) Uses both the Substr and Concatenate operator to format the Employee Tax ID field from F060116 in a social security number xxx-xx-xxxx format. The expression starts with the first position of the field and after 3 characters, insert a dash. Then beginning in the 4th position for 2 characters, then another dash. And finally start in the 6th position for 4 characters.
Substr(Digits(ABAN8),3,5)||' '||ABALPH Uses the digits operator to convert the Address Book Number from F0101 so that last 5 characters of the field can be concatenated to the Alpha Name field with two spaces in between. 10244 Sally Jones
Decimal((SDUORG * COUNCS),15,2) Creates a packed field multiplying the Quantity Ordered from F4211 by the Unit Price from F4105. This field is defined as fifteen packed characters with two decimal places

A calculated field can be used just like a file field, as follows:

  • In another calculation

  • For sorting purposes

  • To select data

  • In Total Level Hdr and Total Line Text

5.10 Using Data Selection

Regardless of the amount of information contained in the files selected, you can selectively print only the data you wish to see on the report. For instance you may want only records within a certain date range.

If no data selection is entered all records will be output, unless restricted by Business Unit Security.

Data selection lets you specify fields in the database that are compared to the values that you are interested in. Only those records that match all of your criteria will be included in the query output. Fields can be tested against constants (numbers or strings), fields in the database or calculated fields that you created.

The Data Selection screen requires an equation for selecting data. This equation involves the following information:

  • And/Or logic

  • The field you want to base your selection on

  • The Boolean Logic test operand resulting in specific information being selected for your report

  • The value parameter, specifying the data against which you want to compare the parameter

Figure 5-11 Data Selection screen

Description of Figure 5-11 follows
Description of "Figure 5-11 Data Selection screen"

Field Explanation
And/Or A code that determines whether compound data selection logic is based on an AND condition or an OR condition.

AND – Combines and continues selection criteria. This is the default.

OR – Begins a new condition that consists of the OR line and consecutive AND lines.

Description The description of the field that contains the data you want to select on. The test field name is found in the fold area of this screen.
Selection Test Specifies the Boolean Logic test to perform between the data field and selection value. Use Field Sensitive Help F1 for a list of valid values, also described in the Boolean Logic section.
Selection Value Contains the values to compare against.

Field Sensitive Help F1 is useful in to obtain a list of valid values if the field is attached to a User-defined Code table or a Search window.

Use F1 to determine the correct field formatting for length and type.

You do not need to know the Julian date format. Enter these date fields as MMDDYY (or User Preference/System format). The program will edit the entry for a valid date and format the field correctly.

You can use a field name to compare with another field. The exception is comparing a date field to another date field. See Appendix D, "Data Select on Julian Date Fields" for this procedure.

Numbers will be edited and displayed with the same decimal positions as the field.

Alpha field entries must be enclosed in single quotes (') and cannot be longer than the selection field length. Shorter strings are compared as if the missing positions are blank.

If a character field is specified in Data Dictionary as having a Data Display Rule of '*RAB', the field is right-justified with leading blanks (see MCU as an example).

To select on a blank numeric field, type 0 (zero).

To select on a blank alpha field, type '' (2 single quotes).

See Appendix D, "Data Select on Julian Date Fields" for the procedure to select on a blank Julian date field.


Note:

Press F4 to display more details in the fold area.

Figure 5-12 Data Selection (Details) screen

Description of Figure 5-12 follows
Description of "Figure 5-12 Data Selection (Details) screen"

Field Explanation
Sequence Assigned by the program. If it is necessary to insert a line, assign the sequence number so that it lies between the sequence numbers of the lines before and after the selected fields.
BU Edit (Y/N) Indicates that the data field is a Business Unit and may be subject to Business Unit Security. Input incapable.
Field Name Used if you need to data select on a calculated field. Enter the name of the field. Leave the File ID field blank.
File ID Assigned when files are specified in Version Title & Files. If blank, this is a calculated field.

5.10.1 Options

5 - If any of the value or range tests are specified, a "+" in the option column indicates that there are more values. Use Option 5 to display the Query Selection Values screen to review or change the selections.

9 - Deletes a previously selected field.

5.10.2 Function Keys

F9 - Replicate selected fields. This enables you to quickly set up an OR condition using the same fields with different values.

F15 - Display the fields tagged on the Field Selection List. The tag list is active only for the current session.

F16 - Displays all fields in the selected files.

5.10.3 Query Selection Values

When selecting data using VALUE, NVALUE, RANGE, NRANGE, the first value or beginning range is entered and shown on the Data Selection screen (V82107). The remaining values or ending range are entered and shown on the Query Selection Values screen:

  • For RANGE or NRANGE tests, only two entries can be made.

  • For VALUE or NVALUE tests, at least two entries are required. (If only one value is needed, use the EQ or NE test)

  • Separate the entries by at least one space.

  • Duplicate entries will cause an error and must be removed.

  • Field Sensitive Help F1 is useful here to obtain a list of valid values if the field is attached to a User-defined Code table or Search window.

  • Alphanumeric fields must be enclosed in single quotes (').

Figure 5-13 Query Selection Values screen

Description of Figure 5-13 follows
Description of "Figure 5-13 Query Selection Values screen"

5.10.4 About AND/OR

This condition is used with more than one equation. Connect multiple equations with an AND condition or an OR condition.

  • You use AND when all the conditions in the equation must be met before a record is written.

  • You use OR when only one condition must be met, or when you want to begin a new set of selection criteria.

Figure 5-14 When to Use "And" and "Or"

Description of Figure 5-14 follows
Description of "Figure 5-14 When to Use "And" and "Or""

5.10.5 Boolean Logic Available for Data Selection

You can use these Boolean logic arguments to select your data.

Test Example
EQ (Equal to) Amount EQ 5000 retrieves only those records with amounts equal to 5000
LT (Less than) Amount LT 5000 retrieves only those records with amounts less than 5000
LE (Less than or equal to) Amount LE 5000 retrieves only those records with amounts equal to or less than 5000
GT (Greater than) Amount GT 5000 retrieves only those records with amounts greater than 5000
GE (Greater than or equal to) Amount GE 5000 retrieves only those records with amounts equal to or greater than 5000
NE (Not equal to) Amount NE 5000 retrieves only those records with amounts not equal to 5000
NL (Not less than) Amount NL 5000 retrieves only those records with amounts not less than 5000
NG (Not greater than) Amount NG retrieves only those records with amounts not greater than 5000
LIKE (A certain part of an alphanumeric field containing the same characters as the test value pattern Name LIKE - __TIN retrieves those names that have two characters followed by TIN

Name LIKE - %TIN% retrieves those names that contain TIN, no matter what characters are before or after it.

NLIKE (A certain part of the field that does not contain the same characters as the test value pattern) Name NLIKE - __TIN retrieves only those names that do not have two characters followed by TIN.

Name NLIKE - %TIN% retrieves those names that do not contain TIN no matter what characters are before or after it.

RANGE (No less than the first value and no greater than the second value) Amount Range 5000 7000 retrieves records with amounts between 5000 and 7000.

5000 and 7000 would be included.

NRANGE (Less than the first value and greater than the second value) Amount Range 5000 7000 retrieves records with amounts that are less than 5000 and greater than 7000.

5000 and 7000 would not be included.

VALUE or VALUES (Retrieve the items listed) Selects multiple items.
NVALUE (Do not retrieve items listed) Omits multiple items.

5.11 Using Data Sort & Totaling

The Data Sort & Totaling screen is used to sort the data into meaningful groups. Without any sorting, sequence of the data will not be in any particular order.

Total levels can be assigned to initiate a break between groups of data. A level break is used to setup special processing, such as printing subtotals, skipping to a new page, skipping multiple lines, or printing related text.

To Sort Data

On Data Sort & Totaling

  1. Complete the following fields:

    • Seq (Sequence)

    • A/D (Ascending and descending)

  2. Assign sequence numbers by 10s to the fields used for sorting.

    Note:

    The highest sort field has the lowest sequence number. For example, sort the data first by company. Within each company, the system sorts the data by business unit, and within each business unit, by object account. For example, the sequence numbers include 10 Company, 20 Business Unit, and 30 Object.
  3. If the grand total does not display on the screen, choose F15. The grand total should always be the last sequence number.

    Note:

    All sorting fields must also display on the Output Field Specifications screen, although they do not have to be printed columns. If a field is used on the Data Sort & Totaling screen that does not appear on Output Field Specifications, the program will add it as a non-printed field by assigning it the next sequence number.

5.11.1 Total levels

Total levels and the additional functions associated with them are for printed output. Only detail records can be output to a physical file.

If the report requires break levels, the next step is to assign Total Levels for the fields where additional functions will be performed.

You must then define the additional functions to include when a break level occurs. The following require you to assign a Total Level:

  • Summary Functions

  • Page Skip

  • Line Spacing

  • Total Level Text in Header

  • Total Line Text

A level break occurs when the value of the field changes from one record to the next.

Assign level breaks in the same order as sequence numbers, but in increments of one.

For example, the following represents a total level at the Company and Object levels.

  • 10. Company - total level 1

  • 20. Business Unit - no total level

  • 30. Object - total level 2

Note:

You do not have to assign a total level to a Grand Total Level, but you do have to specify a sequence number to include it.

Figure 5-15 Data Sort and Totaling screen

Description of Figure 5-15 follows
Description of "Figure 5-15 Data Sort and Totaling screen"

Field Explanation
Seq Assigns a sequence number to order the sort fields. The lower the number, the higher the sort priority. That is, a field with a sequence of 20 will sort within the values of a field with a sequence of 10.

A sequence number must be assigned to select a field for sorting, and all sequence numbers will be renumbered in increments of 10.

Description The field text specified in the Data Dictionary
A/D The code that specifies the ordering of the data in the sort field.

A – Ascending - data is sorted from lowest to highest

D – Descending - data is sorted from highest to lowest

Tot Lvl (Total Level) Used to define report break fields. A report break occurs every time the contents of a break field change from one record to the next. Break fields are tested from highest priority to lowest (highest priority is the break field with the lowest number). A report break at a given level will cause a break at all the lower priority levels as well.

Break levels should be assigned in the same relative order as the sort levels. That is, the highest assignable break level (level 1) should be assigned to the highest sort priority (the sort field with the lowest sequence number). The next break level should be assigned to some lower priority sort level and so on.

Page Skip Y – Indicates that a new page should be started when the value of this field changes

S – Indicates printing summarized information on this field level

A total level must be specified for a page skip to occur. Normally only one total level should specify page skipping.

Line Spc Indicates the number of lines to advance after printing this total line. The default value (*DF) is the line spacing specified in Additional Parameters.

A total level must be specified for this line spacing to occur.

Sum Fnc The code that specifies whether to print any summary functions associated with this total level as entered on the Total Level Summary Functions screen.

If N is entered, no total line data will print for this level, but any page or line spacing will occur.

Sort Field This is the name of the field in the file.
From File The File ID identifies which file contains the requested field.

Note:

Press F4 to display more details in the fold area.

Figure 5-16 Data Sort and Totaling (Detail) screen

Description of Figure 5-16 follows
Description of "Figure 5-16 Data Sort and Totaling (Detail) screen"

Field Explanation
Total Level Hdr Contains 60 characters to enter a subheading comprised of literal text and/or field values that print before a group of data. Use an & (ampersand) before a field name to initiate printing the field value, i.e. &ABALPH.

On the Report Layout screen, literal text is shown and any fields denoted with the ampersand (&) will appear as the letter H.

Total Line Text Contains 60 characters to enter literal text and/or field values that print after a group of data and before the summary functions line. The Row Description from Data Dictionary defaults on this line. This can be modified to desired text or removed. Use the & (ampersand) before a field name to initiate printing the field value, i.e. &ABALPH.

On the Report Layout screen, literal text is shown and any fields denoted with the ampersand (&) will appear as the letter D.


5.11.2 Options

1 - When you initially set up a Total Level, you are automatically taken to the Total Level Summary Functions screen. Option 1 also takes you to this screen to review or change the selections.

9 - Delete a previously selected field.

5.11.3 Function Keys

F13 - Display the Report Layout screen.

F15 - Display the fields tagged on the Field Selection List. The tag list is active only for the current session. Also used to retrieve the Grand Total Level.

F16 - Displays all fields in the selected files.

5.12 Using Total Level Summary Functions

One of the main reasons for assigning a Total Level is to add summary functions when a break in the data occurs.

You can specify up to five summary functions per total level and grand total level.

On the Data Sort & Totaling screen (V82108), if you initially assign a Total Level to a field or a sequence number to the Grand Total Level field, you can then press Enter to automatically display the Total Level Summary Functions screen. You can also enter 1 in the Option field to display the Total Level Summary Functions screen.

The text for summary functions is stored in UDC table 82/GR. If the text is changed in this table, it is changed for all World Writer reports.

At the top of the screen the system displays the Total Level number, Field Name and Description. Assign summary functions to each Total Level one at a time, including the Grand Total. If you have three total levels and a Grand Total and your report requires summary functions at all four levels, you will need to access this screen four times.

Only the fields that display on Output Field Specifications (V82104) are available for summary functions. If a calculated field does not display on this screen, it can be added manually by typing the field name on a blank line.

The following is an example of the summary functions:

Function Amount (numeric field) Name (alpha field)
  50.00

150.00

75.00

225.00

100.00

Smith, John

Jones, Mary

Torres, Jose

Wu, Ann

Brown, David

Sum 600.00 N/A
Avg 120.00 N/A
Min 50.00 Brown, David
Max 225.00 Wu, Ann
Cnt 5 5

To select summary functions

The Total Level number, Field Name and Description are displayed at the top of the Total Level Summary Functions screen, indicating the current break level.

On Total Level Summary Functions

Figure 5-17 Total Level Summary Functions screen

Description of Figure 5-17 follows
Description of "Figure 5-17 Total Level Summary Functions screen"

  1. Assign summary functions to each Total Level one at a time, including the Grand Total.

    If you have three total levels and a Grand Total, and your report requires summary functions at all four levels, you will need to access this screen four times.

    Note:

    Only the fields that appear on Output Field Specifications (V82104) are available for summary functions. If a calculated field does not appear on this screen, it can be manually added by typing the field name on a blank line.
  2. Enter X in the column(s) for each type of total to calculate.

  3. To choose all summary functions, enter 1 in the following field:

    • OP

    Note:

    Up to five summary functions can be specified for a numeric column, three for an alpha column. Sum and Average cannot be used with alphanumeric fields.
Field Explanation
Description Represents the field text specified in the Data Dictionary.
Sum (Summary) Totals all values; valid for numeric fields only.
Avg (Average) Totals all values, then divides by the number of records; valid for numeric fields only.
Min (Minimum) Prints the lowest value in the group for numeric fields. Negative numbers are considered lower than zero or any positive number.

For alpha fields, print the first alphabetical value. Character fields are compared according to the standard EBCDIC collating sequence.

Max (Maximum) Prints the highest value in the group For numeric fields. Negative numbers are considered lower than zero or any positive number.

For alpha fields, print the last alphabetical value. Character fields are compared according to the standard EBCDIC collating sequence.

Cnt (Count) Prints the number of records in the group. This value will be the same no matter which field is selected at the total level.
Field Name The name of the field in the file.
File ID The File ID identifying which file contains the requested field.

5.12.1 Options

1 - Marks all summary functions with an X.

9 - Deletes a previously selected field.

5.12.2 Function Keys

F13 - Display the Report Layout. Use this periodically to determine what additional changes you might need to make.

F15 - Display the fields tagged on the Field Selection List. The tag list is active only for the current session.

F16 - Display all fields in the selected files. You cannot assign summary functions to any fields that do not appear as printed columns on Output Field Specifications.

5.13 Using Report Layout Display

Although the Report Layout screen is not part of the setup process, it is available from many of the setup screens. It is an easy way to see how your report will look without having to actually run the version. It contains the column headings, one detail line and any total levels and summary functions you may have specified.

This feature is available using F13 from all of the setup screens that can affect the layout of your report, such as Output Field Specifications and Data Sort & Totaling. It is also available from the Versions List (cursor position sensitive).

When making changes involving line wrapping, column spacing, header text, etc. use this feature frequently to view the changes and determine any additional changes.

Figure 5-18 Query Report Layout Display screen

Description of Figure 5-18 follows
Description of "Figure 5-18 Query Report Layout Display screen"

Approximately 80 characters are displayed on the screen. Function keys 19 and 20 scroll to the left and right. Or, you can enter a character position in the Window Column field to automatically move to that character space.

5.14 Using Printer File Overrides

The Printer File Overrides screen provides a way to change the default attributes of printer output.

World Writer uses the system printer file called QSYSPRT. If no overrides are entered, the attributes of QSYSPRT are used.

These are standard IBM override options. A similar screen is used with DREAM Writer, FASTR and STAR reporting tools.

Many of the available options are dependent on the type of printer you have and your printer must support the entries you make.

It is best to initially leave the default attributes until a sample of the report has been printed and reviewed. Then make any adjustments if needed.

To access Printer File Overrides

Figure 5-19 Printer File Overrides screen

Description of Figure 5-19 follows
Description of "Figure 5-19 Printer File Overrides screen"

You can access the Printer File Overrides screen by doing any of the following:

  • Enter 6 in the Option field on the Versions List (V82100).

  • Enter 1 in the Option field on the Selective Change Prompt.

  • Choose F5 on the Version Title & Files (V82101).

Field Explanation
Print Queue A designation of a specific print queue, such as QPRINT. If left blank, this field defaults to the print queue specified in your user profile.
Hld in Prt Queue (Y/N) A flag used to determine whether to hold the print file in the print queue rather than printing it.

Valid values are:

Y – Hold on the print queue

N – Do not Hold on the print queue

S – Hold and Save on the print queue

T – Do not Hold, but Save on the print queue

Note: You can use 1 for Y and 0 (zero) for N.

Number of Report Copies The number of copies of this report to be printed. One copy is the default.
Save Spool File Indicates whether the spool file should be set to a SAV status after printing.
Char./Inch (10/15) The horizontal printing density. This should be entered as the number of characters per inch and must be supported by your printer.
Form Type Specifies the type of forms to be used in the printer.
Lines/Inch (4/6/8/9) The line spacing should be entered as the number of lines per inch and must be supported by your printer.
Location of Page Overflow A field used in the definition of a report version to indicate the number of lines to be printed on a specific form before page overflow is detected.
Maximum Form Length A field used in the definition of a report version to indicate the length of the form on which the requested report is to be printed. This is expressed in lines per page.
Maximum Form Width A field used in the definition of a report version used to indicate the width of the form on which the requested report is to be printed. This is the same field found on the Additional Parameters screen (V82109). It can be changed from either screen.
Printer Device Name Specifies the name of the printer device.
Intelligent Printer Specifies the type of data stream to create for a printer file.
Print Text The Print Text field specifies a character string that will be printed at the bottom of each page of the specified report. A maximum of 30 characters are allowed. Refer to "PRTTXT" keyword of the "OVRPRTF" command on the iSeries.