Вы находитесь на странице: 1из 14

CR - Continuous Replenishment

Online TELON Overview Order Calculation Author : Brian Shepherd Date Created : 2. March 1999 Last Updated : 9. December 05

CR Programme On-line TELON Overview

Version 1 Page : 2

Table of Contents
1 Introduction................................................................................................................3 2 Online TELON Structure..........................................................................................4
2.1 Output Processing.........................................................................................................4
2.1.1 A-100-OUTPUT-INIT............................................................................................................4 2.1.2 B-100-OUTPUT-EDITS.........................................................................................................4

2.2 Input Processing............................................................................................................5


2.2.1 P-100-PFKEYS.......................................................................................................................5 2.2.2 D-100-INPUT-INIT................................................................................................................5 2.2.3 E-100-INPUT-EDITS..............................................................................................................5 2.2.4 X-100-CONSIS-EDITS...........................................................................................................5 2.2.5 H-100-INPUT-TERM.............................................................................................................5

3 TELON Time Savers..................................................................................................6


3.1 Panel Image...................................................................................................................6 3.2 Panel Definition.............................................................................................................6 3.3 Data Access....................................................................................................................6 3.4 List Processing..............................................................................................................6 3.5 Miscellaneous Useful Variables...................................................................................7
3.5.1 Control-Indicator.....................................................................................................................7 3.5.2 Various Segloop Variables......................................................................................................7 3.5.3 <database name>-<database column name>-NU....................................................................7 3.5.4 Various TELON Attribute Variables.......................................................................................7 3.5.5 TPO Variables.........................................................................................................................7 3.5.6 TPI Variables...........................................................................................................................8 3.5.7 'DBNAME' Variables..............................................................................................................8

4 Custom Code Points...................................................................................................9


4.1.1 OINIT1....................................................................................................................................9 4.1.2 OINIT2....................................................................................................................................9 4.1.3 OCUST1..................................................................................................................................9 4.1.4 OCUST2..................................................................................................................................9 4.1.5 OCUST3................................................................................................................................10 4.1.6 OUTTERM............................................................................................................................10 4.1.7 ##PFKnnn..............................................................................................................................10 4.1.8 ININIT1.................................................................................................................................10 4.1.9 ININIT2.................................................................................................................................11 4.1.10 ICUST1................................................................................................................................11 4.1.11 ICUST2................................................................................................................................11 4.1.12 FLDEDIT............................................................................................................................11 4.1.13 CONSIS...............................................................................................................................11 4.1.14 INTERM..............................................................................................................................12 4.1.15 SECTION............................................................................................................................12 4.1.16 WKAREA............................................................................................................................12 4.1.17 XFERWKA.........................................................................................................................12

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview

Version 1 Page : 3

INTRODUCTION
This document is meant to be used as an online TELON memory jogger. For people new to TELON it is strongly recommended that they have an experienced TELON developer walk through this document with them. Once a developer is familiar with this document, they will have a rudimentary understanding of a 'mainstream' Online TELON so that they will: Have an understanding of the structure of an online TELON program.

TELON has a very standard structure, and it expects certain logic to be performed in set places. This causes significant savings in maintenance, as a developer will know where to look for such things as data retrieval, edits, and updates. Know what TELON can do for them.

TELON is a panel driven build tool where a developer keys in information into panels, and TELON will then generate a program. It has many features that once known will enable a developer to significantly reduce the amount of code that they themselves will need to write. Know where is the most appropriate place to put their code.

Due to TELON's standard structure, TELON will expect developers to put certain types of logic (e.g. data retrieval, edits, and updates) in fixed points (called Custom Code Points) in the program. It is essential that developers are aware of the various custom code points in TELON and what they should be used for. Note: This document is not meant to deal with the more complex/unusual program that a developer might need to handle. If a developer is not well versed with TELON and needs to write a complex TELON program, it is strongly recommended that before the developer starts any coding at all that they see an experienced TELON developer. The reason for this is that the experienced TELON developer should be able to highlight what TELON can automatically do for them, and not end up coding all the program logic themselves.

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview

Version 1 Page : 4

ONLINE TELON STRUCTURE


An online TELON program is divided into two main parts - an output side and an input side. The most typical flow of TELON online programs is as follows: When a user flows from one screen to another, before the second screen will be displayed the output side of the TELON program is executed. The screen is then displayed, the user would then perform whatever action and press either an enter key or PFkey which would then cause the input side of the TELON program to be executed. Please refer to attachment A as appropriate, which contains a detailed Online TELON Structure Chart as you read through the rest of this document.

2.1

Output Processing
The purpose of the output side of a TELON program, as the name suggests, is to retrieve data, and format the data so that it can be displayed in a meaningful way on the screen. The output side of a TELON program is divided into two main sections:

2.1.1

A-100-OUTPUT-INIT The primary purpose of this section is to: Allow any initial output processing to be done, such as getting the system date, some initial reads, and output formatting that may be required.

2.1.2

B-100-OUTPUT-EDITS The primary purpose of this section is to: Map to the output fields on the screen any corresponding DBNAME (see paragraph 'DBNAME Variables' on page 8) specified on the Panel Definition. This mapping of data can also involve TELON performing various automatic functions, such as ensuring the field is of a certain type (eg. numeric, char, dollar, etc.), reformatting the field, suppressing output. Perform output list processing, where TELON will as much as possible (ie. handle the data retrieval for a list, and the paging forward and backwards logic). Allow the developer to add any other final output logic they require, such as an output message, protection of field(s).

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview

Version 1 Page : 5

2.2

Input Processing
The purpose of the input side of a TELON program, as the name suggests, is to process input received by the user, whether it is data keyed in or a PFkey being pressed. The input side of a TELON program is divided into four main sections:

2.2.1

P-100-PFKEYS The purpose of this section is to deal with all the PFkey processing in a TELON program, such as PF1 for Help, PF2 for Hold, and so on. D-100-INPUT-INIT The purpose of this section is to deal with any initial data retrieval, or editing that is required before the program proceeds onto perform the main edits. Typical logic that this section contains is validation of 'keys' fields. E-100-INPUT-EDITS The primary purposes of this section is to: Map to the DBNAME (see paragraph 'DBNAME Variables' on page 8) fields any corresponding screen field specified on the Panel Definition. This mapping of data can also involve TELON performing various automatic functions, such as ensuring the field is of a certain type (eg. numeric, char, dollar, etc.), reformatting the field. Perform input list processing, where TELON will loop through each line on a list and as much as possible perform validation logic itself, and allow you the developer to add additional validation logic. Allow the developer to add their own field edit logic.

2.2.2

2.2.3

2.2.4

X-100-CONSIS-EDITS The primary purpose of this section is to perform consistency edits, that is any edit that involves more than one field or an edit that involves database checking. H-100-INPUT-TERM The primary purpose of this section is to perform any database update logic and to potentially include logic to transfer to another program.

2.2.5

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview

Version 1 Page : 6

TELON TIME SAVERS


This section will highlight some of the main features that TELON has that will enable a developer to minimise the amount of code that they need to write. Some main features are:

3.1

Panel Image
This allows a developer to paint a screen defining all the input, output, input and output, and literal fields on the screen.

3.2

Panel Definition
This allows a developer to specify: Automatic mapping between the screen fields and the DBNAME fields Automatic editing of the screen fields such as numeric, date, dollar, fullcar, fullnum, etc. Converting a field from one value to another Reformatting the field Automatic output formatting of the screen field via a picture clause Suppression of an output field via a mapout field

3.3

Data Access
TELON has a number of panels in what is called the Data Group. The Data Group enables the developer to bring in table definitions, and to define various data accesses. When defining a data access the developer can via fields on various panels specify: What type of access it is, such a read, readnext, delete, and update. Whether they want the read to be performed automatically in set place(s) by TELON (very handy in particular for list processing) or whether they want to perform the read themselves in Custom Code. The columns they want returned The predicate they want The order by clause The group by clause The having by clause SQL return codes to allow through, any return codes not specified will cause TELON to automatically go into its abend processing since it validly assumes that you have encountered corrupt data and want to abend.

3.4

List Processing
TELON can generate a lot of the logic needed to display a list screen, and in some cases all but a couple of lines. It can handle:

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview

Version 1 Page : 7

The paging forward and backwards logic, Setting of a more pages indicator, Database read to populate the list, as long as the list has one main 'driving' cursor read, It can save any of the fields in a line on the list to a table so that they can be referred to in subsequent processing Maintaining various variables such as line-count (number of lines displayed on the list), input-line-count (number of rows the user have selected), page number, line-errors (is set to true when an input field on a line on the list is found to be in error), current-segment-key (contains the first key to be used on the next page of the list).

3.5

Miscellaneous Useful Variables


There are a number of variables that TELON uses that are important to be aware of, since you will need to use several of them, and others are can be extremely useful if used appropriately. Some of the more important TELON variables are:

3.5.1

Control-Indicator This variable is used by TELON to control the execution of the online program. The control indicator has a number of 88s, these being processoutput, do-write, process-input, do-transfer, continue-process, and transactioncomplete. It is vital that any TELON developer understands how the control indicator variable works. Various Segloop Variables There are several segloop variables that are extremely handy to be aware of. See paragraph 'List Processing' earlier in this chapter. <database name>-<database column name>-NU For every nullable DB2 column TELON will general an 88 variable you can use to test whether the column is not null. For example, column STKDPROD-ENDT in table VXJJ0BBP that is nullable would by TELON have an 88 variable defined as VXJJ0BBP-STKD-PROD-ENDT-NU. Various TELON Attribute Variables There are a number of predefined attribute variables that TELON set up that you as a developer can use to set the attribute of a field. In particular ERRORATTR, PROT-ATTR, and CURSOR-ATTR are three attributes frequently used. Other attribute variables are OK-ATTR, OUTPUT-ATTR, OUTPUTBLANK-ATTR, BLANK-ATTR, CURSOR-BLANK-ATTR, INPUTBLANK-ATTR, OUTPUT-HIGH-ATTR, INPUT-HIGH-ATTR. TPO Variables TPO variables are variables that will be outputted to the screen, via the message area. The TPO variables are mapped to in the B-100-OUTPUT-

3.5.2

3.5.3

3.5.4

3.5.5

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme Version 1 On-line TELON Overview Page : 8 EDITS section by TELON if a DBNAME was specified for the screen field on the panel definition. If a screen field does not have a DBNAME specified for it, it means that as the developer you intend to manually set up the screen field yourself. A particular important TPO variable to be aware of is TPO-ERRMSG1 which must be defined on every online TELON screen, and is the field into which all messages that you want to be displayed on the screen should be moved to. 3.5.6 TPI Variables TPI variables are variables that will be populated from via the message area. The TPI variables are moved to a DBNAME field (if one was specified) in the E-100-INPUT-EDITS section by TELON. All TPI fields will generally have a DBNAME specified for it as developers should reference the DBNAME field in their code rather than the TPI field. 'DBNAME' Variables 'DBNAME' variables are entered on the Panel Definition screen of TELON. The DBNAME entered on the Panel Definition screen can be a DCLGEN variable, a general working storage variable, or a XFER variable. When a DBNAME is specified on the panel definition it will result in the TPI variable being mapped to the corresponding DBNAME variable in E-100-INPUTEDITS, and in the DBNAME variable being mapped to the corresponding TPO variable in B-100-OUTPUT-EDITS. DBNAME variables should be used whenever possible as it can cut down significantly on the amount of custom code and working storage that you need to write. For example, if you specify a DB2 column name for a output field, it means that after you have read the row that TELON will automatically move that DB2 column to the corresponding TPO field. There in this case no need to manually move the DB2 column to the TPO field yourself. DBNAME variables are typically not used when you need to perform some manual formatting on the field before it can be mapped to a TPO field.

3.5.7

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview

Version 1 Page : 9

CUSTOM CODE POINTS


TELON has a very fixed structure and only allows native COBOL code to be entered at fixed points in the program - these fixed points are called Custom Code points. The rest of this chapter will outline all the standard custom code points in an online TELON program, and outline what type of code should be put in each custom code point. Custom code points are as follows:

4.1.1

OINIT1 This custom code point that occurs at the beginning of output processing, before TELON does any automatic non-segloop reads. Is generally used to: Determine if first time in the transaction Set up today's date & time if required Set up host variables needed for any automatic non-segloop reads Manually perform non-segloop reads Manually format non-segloop fields

4.1.2

OINIT2 This custom code points occurs in output processing, just after TELON has performed any automatic non-segloop reads. Is generally used to: process the data retrieve via a non-segloop automatic read

4.1.3

OCUST1 This custom code point occurs in output processing, and is the first custom code point for segloop processing. This custom code point happens just before the actual segloop occurs. Is generally used to: Manually perform the first segloop read. The segloop read should only be performed manually if an AUTOEXEC BROWSE could not be used. Manually format any output fields in the list to the TPO fields

4.1.4

OCUST2 This custom code point occurs in output processing, and is the second custom code point for segloop processing. This custom code point happens within the actual segloop and will be performed 'n' times (where 'n' will be the number of lines on the screen if there are enough rows on the table being read, otherwise 'n' will be the number of rows still to be read on the table). This means that if

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme Version 1 On-line TELON Overview Page : 10 that there are more pages to displayed the last row read will contain the key to be used if the user pages forward. Is generally used to: Manually perform the segloop read. The segloop read should only be performed manually if an AUTOEXEC BROWSE could not be used. 4.1.5 OCUST3 This custom code point occurs in output processing, and is the third custom code point for segloop processing. This custom code point happens within the segloop, and is perform for how many rows there are on the screen-1, assuming there are more pages to follow, otherwise it will be performed for the remaining rows fetched within the loop. Note: If the screen if filled, then this custom code point will be performed once less than OCUST2. Is generally used to: Manually format any output fields in the list to the TPO fields 4.1.6 OUTTERM This custom code point is the last custom code point that occurs in output processing. Is generally used to: Set up the more pages literal for a list screen Protect segloop lines with no data Display an output message if appropriate Reposition the cursor 4.1.7 ##PFKnnn This custom code point is the first custom code point that occurs in input processing. Where ## is the application code (e.g. JJ, JL, or JK), and nnn is any three byte string you want to give for meaningfulness (eg. ALL, 001, 002, 1&3, etc.). Is generally used to: Code PFkey logic, such as PF1 for Help, and PF2 for hold. 4.1.8 ININIT1 This custom code point that occurs in input processing, before TELON does any automatic reads. Is generally used to: Perform any 'key field' edits. This only needs to be done if you have a screen where the user enters in a key, and the same screen then goes and gets the data. Most (if not all) screens within TESCO do not operate in this way. The key of the screen is always passed in via the previous screen. /var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview Set up host variables needed for any automatic reads 4.1.9

Version 1 Page : 11

ININIT2 This custom code point that occurs in input processing, just after TELON has performed any automatic reads. Is generally used to: Process the data retrieved via an automatic read

4.1.10 ICUST1 This custom code point occurs in input processing, just before TELON has mapped its segloop TPI fields to the DBNAME fields. Is generally used to: Manually perform any edit checks on input segloop fields prior to TELON performing any automatic mapping. This custom code point is hardly ever used, and it is recommended that before any uses it that they speak to at least one other TELON developer to run through why they should use it. 4.1.11 ICUST2 This custom code point occurs in input processing, just after TELON has mapped its segloop TPI fields to the DBNAME fields. Is generally used to: Manually perform any edit checks on input segloop fields. Handle the 'select' field processing on a list. This includes: manually validating the field as appropriate, if a row is validly selected to move appropriate data from that row to the XFER area and set the next-programid up to transfer to the appropriate program. Hopefully a technical hint on handling input list processing would be produced shortly. 4.1.12 FLDEDIT This custom code point occurs in input processing, just after TELON has mapped its TPI fields to the DBNAME fields. Is generally used to: Manually perform individual field edits. It should not be used to perform any consistency checks across multiple fields - the CONSIS custom code point should be used to do this. 4.1.13 CONSIS This custom code point occurs in input processing, just after all the individual field edits have been performed. Is generally used to: /var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview Manually perform cross-field validation.

Version 1 Page : 12

4.1.14 INTERM This custom code point occurs in input processing, just after all field validation has been performed. Is generally used to: Apply any database updates, creates, and/or deletes. Put out a confirmation message stating whether the updates were successful or not. Can be where manual screen transfer code can also occur. 4.1.15 SECTION This custom code point occurs neither in the input or output side of TELON. It is a custom code point that can be used to create Sections that can be performed from other custom code points. Is generally used to: Contain sections of code that will be performed from several places within custom code. Contain sections to enable the custom code that is written to be more structured and maintainable. 4.1.16 WKAREA This custom code point occurs in the working storage section of a TELON program. Is generally used to: Enter in your own working storage variables. 4.1.17 XFERWKA This custom code point occurs in the working storage section of a TELON program. Is generally used to: Define the spa area of your TELON program.

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview Attachment A - Online TELON Structure Chart

Version 1 Page : 13

INPUT Processing
MAIN INPUT

> set DO TRANSFER


P-100 PFKEYS > D-100 INPUT INIT > screen type

PFKEYS

ININIT1

? AUTOEXEC

ININIT2

O has NO SELECT fields

O has SELECT fields

? optional(actioned if present) > actioned if control indicator set * iteration O select one box(either/ or)

> E-100 INPUT EDITS

> X-100 CONSIS EDITS

> H-100 INPUT TERM

J-100 SELECT

? M-100 HELP ANALYZE

? generated field edits

? Input segloop processing

FLDEDIT

? XFEDIT SEGEDIT SRC

CONSIS

? AUTOEXEC

INTERM

? perform M-100 for field help

determine option selected

J-100 SELECT-OPTfieldname

? L-100 HOLD SAVE

*
E-100 INPUT SEGLOOP ? perform M-100 for field help ? edit select field ? perform E-100 if INEDIT = Y ? select field consistency edits

? perform H-100 if INDBIO = Y

? set next program if nextpgm field has value

? ICUST1

? generated field edits

? ICUST2
? XFEDIT SEGEDIT SRC

? SCONSIS

/var/www/apps/conversion/tmp/scratch_3/151571715.doc

CR Programme On-line TELON Overview

Version 1 Page : 14

OUTPUT Processing
determine output process

MAIN OUTPUT

> set DO WRITE

O resume from hold

o PROCESS OUTPUT > B-100OUTPUTEDITS

K-100-HOLD -RESTORE

A-100OUTPUTINIT

OINIT1

? AUTOEXEC

OINIT2

N-100CURSORPOSITION

? generated field edits pre-loop

? OUTPUT SEGLOOP processing

? generated field edits post-loop

OUTTERM

? optional(actioned if present) > actioned if control indicator set * iteration O select one box(either/ or)

? set cursor for screen cursor=fld

CURSCUS

? initialise paging areas

? AUTOEXEC if no data exit

OCUST1

* B-100 OUTPUTSEGLOOPEDITS

B-100 OUTPUTSEGLOOP- EXIT

? generated field edits

? AUTOEXEC if no data exit

OCUST2

segloop count if max exceeded EXIT

OCUST3

/var/www/apps/conversion/tmp/scratch_3/151571715.doc