010-cool2e trg ppt

190

Upload: gauravgalaxy

Post on 28-Nov-2014

118 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 010-Cool2e Trg Ppt
Page 2: 010-Cool2e Trg Ppt

COOL:2E Training

Contents•Introduction to COOL:2E•Getting Started•Data Modeling•Building Access Paths•Building Applications•Generating Applications•COOL:2E/1E Utilities

Page 3: 010-Cool2e Trg Ppt

Introduction to COOL:2EIntroduction to COOL:2EWhat is COOL:2E?What is COOL:2E?

– An application development toolAn application development tool

– Allows efficient design, development, Allows efficient design, development, implementation & maintenance of application implementation & maintenance of application softwaresoftware

– Better than third generation development methodsBetter than third generation development methods

– Knowledge of programming language not requiredKnowledge of programming language not required

– Platform independent application designPlatform independent application design

Page 4: 010-Cool2e Trg Ppt

Introduction to COOL:2EIntroduction to COOL:2ECOOL:2E ObjectivesCOOL:2E Objectives

– Design closer to user requirementsDesign closer to user requirements

– Higher quality applicationsHigher quality applications

– Ease of maintenance and enhancementEase of maintenance and enhancement

– Language independent designLanguage independent design

– Applications that make effective use of platformApplications that make effective use of platform

– Increased ProductivityIncreased Productivity

Page 5: 010-Cool2e Trg Ppt

Implementation independenceApplication design developed as high level business logic and designApplications stored as COOL:2E design modelSame application design can generate application to run on AS/400, IBM mainframes, RS/6000

Introduction to COOL:2ECOOL:2E Design Principles

Page 6: 010-Cool2e Trg Ppt

Data-driven DesignApplication design starts with the identification of business entities and their relationshipEntity-Relationship modeling is used to create the COOL:2E data modelFunctions for the end user are subsequently built on the data model

Introduction to COOL:2ECOOL:2E Design Principles (contd..)

Page 7: 010-Cool2e Trg Ppt

Object-based DesignObjects are database entitiesActions are COOL:2E functionsActions and Objects are defined once and reused.

Introduction to COOL:2ECOOL:2E Design Principles (contd..)

Page 8: 010-Cool2e Trg Ppt

• COOL:2E Rapid Prototyping Methodology (RPM) is a COOL:2E Rapid Prototyping Methodology (RPM) is a data-driven, pragmatic approach to Application data-driven, pragmatic approach to Application DevelopmentDevelopment

• Rapid Prototyping MethodologyRapid Prototyping Methodology– AnalyzeAnalyze

• System analysis, E-R diagram, COOL:2E Data model, Primary System analysis, E-R diagram, COOL:2E Data model, Primary access paths, function flows and device designsaccess paths, function flows and device designs

Introduction to COOL:2EApplication Development

Page 9: 010-Cool2e Trg Ppt

• Rapid Prototyping Methodology (contd...)Rapid Prototyping Methodology (contd...)– DesignDesign

• Prototype application, review with user, update design, Prototype application, review with user, update design, continue functions definition, action diagrams, complete continue functions definition, action diagrams, complete database designdatabase design

– ConstructConstruct• Generate final version of application and complete unit testingGenerate final version of application and complete unit testing

– ImplementImplement• Complete integration test, system test and user acceptance testComplete integration test, system test and user acceptance test

Introduction to COOL:2EApplication Development

Page 10: 010-Cool2e Trg Ppt

– Change design model as necessaryChange design model as necessary

– Update the function design for above changesUpdate the function design for above changes

– Regenerate dependant elementsRegenerate dependant elements

Introduction to COOL:2EApplication Maintenance

Page 11: 010-Cool2e Trg Ppt

COOL:2EApplication development tool for AS/400Includes COOL:2E/1E

COOL:2E/2GProvides PC based GUI for COOL:2E

COOL:2E/CSG (Client Server Generator)Option to COOL:2E which allows distributed functionality on multiple platforms

Introduction to COOL:2ECOOL:2E Products

Page 12: 010-Cool2e Trg Ppt

– Entity Relationship SpecificationEntity Relationship Specification• Automatic creation of a data dictionaryAutomatic creation of a data dictionary

• Free format text to describe any design objectFree format text to describe any design object

• Automatic documentation of the design modelAutomatic documentation of the design model

• Specification of domain checksSpecification of domain checks

– Access PathsAccess Paths• Logical views to support functionsLogical views to support functions

• Retrieval of existing DB2/400 descriptions (assimilation)Retrieval of existing DB2/400 descriptions (assimilation)

Introduction to COOL:2ECOOL:2E Features

Page 13: 010-Cool2e Trg Ppt

– FunctionsFunctions• Auto creation of action diagram & panel/report designAuto creation of action diagram & panel/report design

• Modular designModular design

– Panels & ReportsPanels & Reports• Automatic design of panel & report layoutsAutomatic design of panel & report layouts

• Interactive painting facilitiesInteractive painting facilities

• Panel design prototyping facilitiesPanel design prototyping facilities

Introduction to COOL:2ECOOL:2E Features (contd…)

Page 14: 010-Cool2e Trg Ppt

– HLL code generationHLL code generation• DDS or SQL for databaseDDS or SQL for database

• DDS for panels & reportsDDS for panels & reports

• RPG/COBOL for AS/400 stand alone programsRPG/COBOL for AS/400 stand alone programs

• RPG/COBOL for server and COBOL/2 for clientRPG/COBOL for server and COBOL/2 for client

• Automatic help text generationAutomatic help text generation

Introduction to COOL:2ECOOL:2E Features (contd…)

Page 15: 010-Cool2e Trg Ppt

– Other featuresOther features• Automatic implementation of object naming standardsAutomatic implementation of object naming standards• Automatic implementation of panel design standardsAutomatic implementation of panel design standards• Automated documentation of generated systemsAutomated documentation of generated systems• Cross reference facilitiesCross reference facilities• Integration of user source code in generated functionsIntegration of user source code in generated functions• Regeneration of source code after changes in designRegeneration of source code after changes in design• Facilities for commitment control, journaling & error handlingFacilities for commitment control, journaling & error handling• Automatic referential integrity & domain checksAutomatic referential integrity & domain checks

Introduction to COOL:2ECOOL:2E Features (contd…)

Page 16: 010-Cool2e Trg Ppt

• Contain the files and objects needed to use COOL:2E Contain the files and objects needed to use COOL:2E productsproducts– Y1SYY1SY COOL:2E/1E ProductsCOOL:2E/1E Products

– Y1SYVENGY1SYVENG COOL:2E/1E National Language LibraryCOOL:2E/1E National Language Library

– Y2SYY2SY COOL:2E Base productsCOOL:2E Base products

– Y2SYVENGY2SYVENG COOL:2E National Language LibraryCOOL:2E National Language Library

– Y2SYMDLY2SYMDL COOL:2E null modelCOOL:2E null model

– Y2SYCBLY2SYCBL COOL:2E COBOL generatorsCOOL:2E COBOL generators

– Y2SYRPGY2SYRPG COOL:2E RPG generatorsCOOL:2E RPG generators

– Y2SYSRCY2SYSRC COOL:2E sourceCOOL:2E source

Getting StartedCOOL:2E Product Libraries

Page 17: 010-Cool2e Trg Ppt

It is the model in which the development team creates an application and in which initial generation takes place.

Objects are tested in the development environment.

Getting StartedDevelopment Environment

Page 18: 010-Cool2e Trg Ppt

Model LibraryModel Library– Library in which the model residesLibrary in which the model resides

Generation LibraryGeneration Library– Associated with each model libraryAssociated with each model library– Contains source files, compiled programs, help text, Contains source files, compiled programs, help text,

access paths (created using DDS) and journalsaccess paths (created using DDS) and journals SQL CollectionSQL Collection

– Exists only if SQL is used for data definitionExists only if SQL is used for data definition– Contains files, journals, data dictionaries & SQL access Contains files, journals, data dictionaries & SQL access

pathspaths

Getting StartedDevelopment Libraries

Page 19: 010-Cool2e Trg Ppt

YCRTMDLLIB command creates a modelYCRTMDLLIB Command ParametersModel Library Name (MDLLIB)Generation Library Name (GENLIB)Design Standard (DSNSTD) like *CUATEXT etc.File generation method : DDS/SQLSQL Collection Library (SQLLIB)Naming Prefixes

Object Prefix (OBJPFX)Message Prefix (MSGPFX)

Getting StartedCreating/Using a Model

Page 20: 010-Cool2e Trg Ppt

YCRTMDLLIB Command Parameters (contd…)Message File Name (MSGVNM)Default HLL (HLLGEN)HLL Naming Convention (HLLVNM)

Build Library List using YBLDLIBLSTChange job’s library list to contain COOL:2E Development Libraries and Product LibrariesRun command YBLDLIBLST <LIBL-Name>

Getting StartedCreating/Using a Model (contd…)

Page 21: 010-Cool2e Trg Ppt

Run command YSTRY2 <LIBL-Name> to display COOL:2E Master Menu

User can Enter/update the COOL:2E/2 model as Designer(*DSNR) or as a Programmer (*PGMR)

Getting StartedCreating/Using a Model (contd…)

Page 22: 010-Cool2e Trg Ppt

MAIN COOL:2E Master menu Level . : 1 System: S1017323 Select one of the following: DESIGN-MODEL 1. Enter/update COOL:2E model as *DSNR. 2. Enter/update COOL:2E model as *PGMR. ? 3. Change current data model. Other menus 4. COOL:2E commands in alphabetical order. 5. Commands to set up or alter a model. 6. Commands to copy a model. 7. Commands to create an application. 8. Commands to document a model. 9. COOL:2E/1 Programmer aids. + Selection or command ===> F3=Exit F6=Messages F9=Prev. request F10=Cmd Entry F14=Submitted jobs

Getting StartedCreating/Using a Model (contd…)

Page 23: 010-Cool2e Trg Ppt

•A Data Model is a structured description of a set of data and its relationships which can be used to represent the business of an organization•Entity-Relation (E-R) modeling techniques are used to build a conceptual data model•Conceptual data model is then entered in the COOL:2E/2 to build COOL:2E/2 data model

Data ModelingWhat is a Data Model?

Page 24: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

•Identify Primary Entities and their attributes•Identify Relations between Entities and between Entities and the Attributes•Normalize the Data Model

Page 25: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying Primary EntitiesReview the data items from the analysis of business informationSelect objects that are important to the business e.g. entities important to end usersSelect objects about which information must be storedIdentify the business dimensionsGeneralize or differentiate Entities

Page 26: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying Primary Entities - exampleSales Order Entry form of ABC Inc. is shown below

ABC Inc. Customer Copy Customer Code: Name: Phone: Address: Order No.: Date: Product Code Description Qty Price Total ________ ____________ ____ ____ ___ ________ ____________ ____ ____ ___

The following primary entities can be identifieda) Company b) Customer c) Order d) Product

Page 27: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying Primary Entities - exampleFurther study of business of ABC Inc. revealed that products are purchased from vendors for which purchase orders are generated. Therefore the following additional entities were identified

a) Vendor b) Purchase OrderGeneralize Entities

Combine two entities representing different types of the same thing into one entity

Differentiate EntitiesDifferentiate different types of the same thing as two different entities

Page 28: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying Entity AttributesIdentify informational details of an entityEach informational detail of an entity can form the attribute of the entityExample - Customer has the following attributes

Customer CodeCustomer NameCustomer Address

Identify Domains which are the possible values of the identified attributes

Page 29: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying RelationsIdentify relations between Entity and its attributes and between different EntitiesCategorize relationship types by

Optional/MandatoryCardinalityInvolution

Select Primary Key or Unique Identifier for an Entity

Page 30: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying RelationsOptional/Mandatory - Is the relationship Mandatory or Optional?Cardinality - Is the connection one-to-one, one-to-many or many-to-many?

Number of entity instances for a relationshipInvolution - Does the connection exist between two different entities or from the same entity to itself?

e.g. relation between employee and a manager when manager himself is an employee.

Page 31: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying RelationsOne-To-One Relation - each instance of one entity is related to one instance of another entity

assigned toe.g. Salesperson Territory

has

One-To-Many Relation - One instance of an entity is related to multiple instances of another entity

placese.g. Customer Order

placed by

Page 32: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying RelationsMany-To-Many Relation - each instance of one entity is related to more than one instance of another entity and vice versa

e.g. orders ordered by

Order Product

Page 33: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying RelationsSelect Primary Key or Unique Identifier

Primary Key - An attribute or group of attributes assigned to an entity to uniquely identify an instance of the entity e.g. Customer

K Customer CodeCustomer NameCustomer Address

Primary Key can be a single attribute, a relationship or a combination of attributes and relationships

Page 34: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying RelationsImplement Entity to Entity Relationship using Foreign Key

Foreign Key - An attribute or group of attributes of an entity which connects this instance with an instance of another entity

The primary key of one entity when used in another entity is called a Foreign key

Page 35: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying Relations - Foreign Keyexample: One-To-One relation

assigned toSalesperson Territory

hasK Person ID K Person ID

Person Name Territory Name

example: One-To-Many relationhas

Company DivisionPart of

K Company Code K Company Code Company Name Division Code

Division Name

Page 36: 010-Cool2e Trg Ppt

Data ModelingEntity-Relationship (E-R) Modeling

Identifying Relations - Foreign Keyexample: Many-To-Many relation

worked on by

Project Employee works on

worked on by has

Project Project Team Employee works on part of

Project EmployeeK Project Code K Employee Code

Project Name Employee NameProject Team

K Project Code K Employee Code

Page 37: 010-Cool2e Trg Ppt

Data ModelingNormalizing the Data Model

Normalization Involvesregrouping attributessplitting entitiesreassigning primary keys

Functionally Dependent Attributefor each value of the key, there is only one value of non-key attribute

Full Functional Dependent Attributenon-key attributes are dependent on all the key attributes of a composite key

Page 38: 010-Cool2e Trg Ppt

Process of NormalizationCreating First Normal Form (1NF)

eliminate repeating data groupse.g. Order splits into Order Header & Order Detail

Creating Second Normal Form (2NF)entity is 1NFevery non-key attribute is fully functionally dependent on primary key

Creating Third Normal Form (3NF)entity is 2NFeach non-key attribute is not dependent on another non-key attribute

Data ModelingNormalizing the Data Model

Page 39: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E Objects (design elements)File

represents an entity e.g. OrderField

describes an item of data e.g. Order NumberCondition

describes the values or set of values (domains)Relation

describes connection between two files or between file and field e.g. refers to, owned by

Page 40: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

Conceptual Model COOL:2E Data(E-R Model) Model

---------------------------------------------------------------Entity FileAttribute FieldRelationship RelationDomain Field Conditions:

Reference field types

Page 41: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

•Model can be accessed as designer (*DSNR) or as programmer (*COOL:2E provides facilities to enter / update the data model•PGMR)•Edit Database Relations panel allows the entry of data model to COOL:2E

Page 42: 010-Cool2e Trg Ppt

• *DSNR GXMMDL Op: SYNGXM QPADEV0004 21/08/97 17:46:35 *DSNR GXMMDL Op: SYNGXM QPADEV0004 21/08/97 17:46:35 • EDIT DATABASE RELATIONS GXMMDL EDIT DATABASE RELATIONS GXMMDL • => ___ _________________________ Rel lvl: ___ ___ ___ _______________________ => ___ _________________________ Rel lvl: ___ ___ ___ _______________________

• ? Typ Object Relation Seq Typ Referenced object ? Typ Object Relation Seq Typ Referenced object • __ _________________________ ____________ ___ _______________________ __ _________________________ ____________ ___ _______________________

• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________• __ _________________________ ____________ ___ _________________________ _________________________ ____________ ___ _______________________

• ++• SEL: Z(n)-Details, N(n)-Narr, S(n)-Select, E(n)-Entries, V-Virt.fields, F-FuncsSEL: Z(n)-Details, N(n)-Narr, S(n)-Select, E(n)-Entries, V-Virt.fields, F-Funcs• F3=Exit F5=Reload F7=Fields F9=Insert F10=Define obj. F17=ServicesF3=Exit F5=Reload F7=Fields F9=Insert F10=Define obj. F17=Services

Data ModelingCOOL:2E Data Model

Page 43: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FilesEach COOL:2E File has a Name and a File TypeCOOL:2E File Naming rules

must be valid COOL:2E Nameunique within the modelup to 25 characters including embedded blankse.g. Purchase Order is a valid COOL:2E file Name

COOL:2E File TypesFile Attribute Description ExampleDatabase CPT Capture file Order Entry

REF Reference file Company file

Non database STR Structure file Audit date &time

stamp

Page 44: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FilesReference (REF) files

master files that typically contain non-volatile informatione.g. Customer, Product, Area Code

Capture (CPT) filescontain transactional data that is recorded regularlye.g. Order, Ledger Entry

Structure (STR) filescontain group of fields which can be included in other files using Includes relatione.g. Audit Stamp file

Page 45: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FilesDefault functions

standard functions are automatically defined for filesdefault functions depend on file types

Default functions for REF files

Function Access PathCRTOBJ - Create Object UPDDLTOBJ - Delete Object UPDCHGOBJ - Change Object UPDSELRCD - Select Record RTVEDTFIL - Edit File RTV

Page 46: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FilesDefault functions for CPT files

Function Access PathCRTOBJ - Create Object UPDDLTOBJ - Delete Object UPDCHGOBJ - Change Object UPD

Page 47: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FilesCreating/Defining

At the Edit Database Relations panel, press F10 to show Define Objects panelIn the Object type column, enter FILType File Name in Object Name columnType CPT or REF or STR in Object attr column depending on the file typeDefined as relation for the file is automatically created

Page 48: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

Op: SYNGXM QPADEV0004 22/08/97 15:31:12 DEFINE OBJECTS GXMMDL Object Object Object Referenced Field Edit type name attr field usage field ___ ________________________ ___ ________________________ ___ _ ___ ________________________ ___ ________________________ ___ _ ___ ________________________ ___ ________________________ ___ _ ___ ________________________ ___ ________________________ ___ _ ___ ________________________ ___ ________________________ ___ _ ___ ________________________ ___ ________________________ ___ _ ___ ________________________ ___ ________________________ ___ _ ___ ________________________ ___ ________________________ ___ _ + F3=Exit

Page 49: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FieldsEach COOL:2E Field has a Name and a Field TypeCOOL:2E Field Naming rules

unique within the modelup to 25 characters including embedded blankse.g. Customer Code is a valid COOL:2E Field Nameimplementation name is different

COOL:2E Field Typesdepends on the type of values broadly classified as alphanumeric, numeric & special field types

Page 50: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FieldsCOOL:2E Field Types (contd…)

Field Type Name Description Type Length ExampleCDE Code A 6 Stock CodeDTE Date P 7,0 Date of birthIGC Ideographic text A 20 Kanji nameNAR Narrative text A 30CommentsNBR Number P 5.0 # of employeesPCT PercentageP 5.2 Profit marginPRC Price or tariff P 7.2 Unit PriceQTY Quantity P 5.0 Stock quantityREF Reference - - Field based on anotherSGT Surrogate P 7.0 System KeySTS Status A 1 Yes/NoTME Time P 6.0 Change TimeTXT Descriptive name A 25 Product nameVAL Monetary value P 11.2 Stock valueVNM Valid system name A 10 File name

Page 51: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FieldsField Attribute Values

Basic attributes: length, implementation nameText: Left Hand Side (LHS) text, Right Hand Side (RHS) Text, Column HeadingsValidation attributes: upper/lower case checking, Modulus checking, valid name checking, validation through a check condition

Page 52: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FieldsField Usage

Two types: Database fields and Function fieldsDatabase fields

Code (CDE) fields:- used for key fields e.g. Company CodeData attribute (ATR) fields: used for non-key fields e.g. Company Name

Function fieldsfields used only in functions but do not reside in database

Page 53: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FieldsFunction fields (contd…)

fields used only in functions but do not reside in databasefields can be added to data dictionary and accessed in device designs and action diagrams6 function field usage types

CNT (count) DRV (derived)

MAX (maximum) MIN (minimum)

SUM (sum) USR (user-defined)

Page 54: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FieldsDefault Condition

supplies the default value for a field*NONE: no default conditioncondition name: COOL:2E condition supplies default value*DTAARA: Default field value is retrieved from data area specified for the Data area field

Defining Field as a Data Areaspecify *DTAARA as default condition

Page 55: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E FieldsCreating/Defining

In the Object type column of Define Objects panel, enter FLDType Field Name in Object Name columnType COOL:2E field type in the Object attr columnType Referenced field if the field refers to another field for domainIn the Field Usage column, type CDE (Code) or ATR (attribute) or a function field usage

Page 56: 010-Cool2e Trg Ppt

Op: SYNGXM QPADEV0004 22/08/97 15:31:12 DEFINE OBJECTS GXMMDL Object Object Object Referenced Field Edit type name attr field usage field FIL Dealer FIL Dealer group FLD Dealer Code CDE FLD Dealer name ATR FLD Dealer Address 1 ATR FLD Dealer Address 2 ATR FLD Dealer Group Code CDE FLD Dealer Group Name ATR FLD Dealer Group Credit Limit ATR + F3=Exit

Data ModelingCOOL:2E Data Model

Page 57: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E ConditionSpecifies the values or set of values a field may takeCondition has a Name, a type and an associated valueCondition Types

VAL (Value) and LST (Value List) are valid condition types for status fieldsCMP (Compare) and RNG (Range) are valid condition types for non-status fields

Page 58: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E ConditionValue (VAL) Condition

used to specify single values that status field can taketwo related values:

internal value - value in the implemented database

external value - value displayed/entered on the screene.g. Premium paid condition has file value “Y”

List (LST) Conditionused to specify list of values that status field can takescreen functions implement prompt key (F4)e.g. Invoice Flag can have valid values U, D, P, H, C and the condition Invoice not due has file value “U”

Page 59: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E ConditionCompare (CMP) Condition

defined in terms of a fixed value and an operatorvalid operators: *EQ, *NE, *GT, *LT, *GE, *LEe.g. Order Quantity field can have an associated condition by name greater than 10 with operator *GT and value 10

Range (RNG) Conditiondefines range of values that field can takedefined in terms of From and To valuese.g. Stock Quantity field can have an associated condition by name between 10 and 100 with From value as 10 and To value as 100

Page 60: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationExpresses association between two files or between a file and a fieldEight relation types

Defined as, Extended by, Has, Includes, Known by, Owned by, Qualified by and Refers to

3 different relation usage groupsDefinition relations - declare files to existKey relations - define the keys in filesAttribute relations - declare non-key fields in files

Database relations can be entered using Edit Database Relations panel

Page 61: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E Relation

Usage Type Relation Used forDefinition Defined as File-to-file relationshipKey Owned by File-to-file relationship

Known by File-to-field relationshipQualified by File-to-field relationship

Attribute Refers to File-to-file relationshipIncludes File-to-field relationshipHas File-to-field relationship

Other Extended by File-to-file relationship

Page 62: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationDefined as Relation

File-to-file relationdeclares that a file existse.g.

Product Defined asProduct

Defined as relation is automatically created for a file if a reference is made to a non-existing file

Page 63: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationOwned by Relation

File-to-file relationdenotes a parent-child relationshipprimary key(s) of owning file become part of primary key of the owned by filekeys of owning file are incorporated as high order keys in the owned filee.g.

Order Detail Owned byOrder

Page 64: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationKnown by Relation

File-to-field relationspecifies the key field(s) for a filee.g.

FIL Order Known by FLD Order Number

FIL Order Has FLD Quantity

Qualified by RelationFile-to-field relationto qualify a file identifier by one or more variable factors like date, time, sequence number etc

Page 65: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationQualified by Relation

used for entities which represent continuum of values like currency rates having effective dateappropriate fields of referring file can be redirected (RDR) to the effective field in referred file with a possibility of specifying *PREVIOUS or *NEXTfield in the relation must be ATR and not CDEe.g. Product Price Owned by Product Code

Product Price Qualified by Effective date

Product Price Has Product price

Page 66: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationRefers to Relation

File-to-file relationspecifies that a file refers to another fileAllows access to any of the fields on the referred to file from a referring filePrimary key of the referred file becomes foreign key in the referring fileVirtual field is created in the referring file and cannot be updated from the referring filee.g. Order Detail Refers to Product

Page 67: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationIncludes Relation

File-to-file relationfile includes all the fields of a structure (STR) filee.g. Product Includes Audit Stamp

Has RelationFile-to-field relationdeclares a field to be present in a file as an attributee.g.

FIL Order Has FLD Quantity

Page 68: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationExtended by Relation

File-to-file relationdeclares a file to be extension of another fileIf used with Owned by relation, the fields of the extended file are available as Virtual Fields in the file being extendedIt is recommended to use Extended by relation along with Owned by relatione.g. Customer Extended by Customer Detail

Page 69: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationFor Text

For Text clause can be added to a relation to further clarify the description of a relationshipIf a file refers to another file more than once, For Text clause can be used for further clarificatione.g. Order Refers to Customer

For: Ordering Sharing: *ALL Order Refers to Customer

For: Invoicing Sharing: *ALL

Page 70: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationCreating/Defining

At the Object column of Edit Database Relations panel, enter the file nameType the relationship in Relation columnType the referenced object (File or Field) in the Referenced Object column

Edit File EntriesType E in front of any relation to display Edit File Entries panel

Page 71: 010-Cool2e Trg Ppt

• *DSNR GXMMDL Op: SYNGXM QPADEV0004 22/08/97 15:25:26 *DSNR GXMMDL Op: SYNGXM QPADEV0004 22/08/97 15:25:26 • EDIT DATABASE RELATIONS GXMMDL EDIT DATABASE RELATIONS GXMMDL • => Rel lvl: => Rel lvl: • ? Typ Object Relation Seq Typ Referenced object ? Typ Object Relation Seq Typ Referenced object • FIL Dealer Owned by FIL Dealer group FIL Dealer Owned by FIL Dealer group • FIL Dealer Known by FLD Dealer Code FIL Dealer Known by FLD Dealer Code • FIL Dealer Has FLD Dealer name FIL Dealer Has FLD Dealer name • • FIL Dealer Has FLD Dealer Address 1 FIL Dealer Has FLD Dealer Address 1 • FIL Dealer Has FLD Dealer Address 2 FIL Dealer Has FLD Dealer Address 2 • • FIL Dealer Group Known by FLD Dealer Group Code FIL Dealer Group Known by FLD Dealer Group Code • FIL Dealer Group Has FLD Dealer Group Name FIL Dealer Group Has FLD Dealer Group Name • FIL Dealer Group Has FLD Dealer Group Credit LimitFIL Dealer Group Has FLD Dealer Group Credit Limit• • • • • • • + + • SEL: Z(n)-Details, N(n)-Narr, S(n)-Select, E(n)-Entries, V-Virt.fields, F-FuncsSEL: Z(n)-Details, N(n)-Narr, S(n)-Select, E(n)-Entries, V-Virt.fields, F-Funcs• F3=Exit F5=Reload F7=Fields F9=Insert F10=Define obj. F17=Services F3=Exit F5=Reload F7=Fields F9=Insert F10=Define obj. F17=Services • 'Dealer' type FIL not found. 'Dealer' type FIL not found.

Data ModelingCOOL:2E Data Model

Page 72: 010-Cool2e Trg Ppt

• Op: SYNGXM QPADEV0004 22/08/97 16:11:55 Op: SYNGXM QPADEV0004 22/08/97 16:11:55 • EDIT FILE ENTRIES GXMMDL EDIT FILE ENTRIES GXMMDL • • File . . . . . . : Dealer File . . . . . . : Dealer • • ? Field Type Ocr Et Ksq GEN name Length Renamed ? Field Type Ocr Et Ksq GEN name Length Renamed • • Dealer Group Code CDE K 1 AICD 6 Dealer Group Code CDE K 1 AICD 6 • Dealer Code CDE K 2 AHCD 6 Dealer Code CDE K 2 AHCD 6 • Dealer name TXT A AJTX 25 Dealer name TXT A AJTX 25 • Dealer Address 1 TXT A AKTX 25 Dealer Address 1 TXT A AKTX 25 • Dealer Address 2 TXT A ALTX 25 Dealer Address 2 TXT A ALTX 25 • • • • • • • • • • SEL: Z-Details, R-Replace field, U-Usage, M-Mapped field parameters. SEL: Z-Details, R-Replace field, U-Usage, M-Mapped field parameters. • F3=Exit F3=Exit

Data ModelingCOOL:2E Data Model

Page 73: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationEdit Field Details

Type E2 in front of the File-field relation to display Edit Field Details panel for the field ORType Z in front of the field entry in the Edit File Details panel

Page 74: 010-Cool2e Trg Ppt

Op: SYNGXM QPADEV0004 22/08/97 16:11:55 EDIT FIELD DETAILS GXMMDL Field name . . . . . : Booking payment status Document’n seq . : Type . . . . . . . . : STS REF: Payment Status Field usage . : ATR Internal length. . . : 1 Data type : A lowercase: GEN name . : BKST

K’bd shift :

Headings . . . . . . : - Text . . . . . . . . : Booking payment status Left hand side . . . : Booking payment status Right hand side. . . : Value Column headings. . . : Booking

: payment : status

Validation . . . . . : - Default condition. . : *NONE Check condition. . . : *NONE Mandatory fill . . . : (Y, ) Valid System name. . : (Y,’ ‘) Translate cnd vlues : Blank (Y,’ ‘)

F3=Exit no update F8=Change name/type F9=Conditions F20=Narrative

Data ModelingCOOL:2E Data Model

Page 75: 010-Cool2e Trg Ppt

Data ModelingCOOL:2E Data Model

COOL:2E RelationEdit Field Condition

Field condition can be added/modified using the Edit Field Condition and Edit Field Condition Detail panelsPress F9 on the Edit Field Details panel to display Edit Field Condition panelIn the Edit Field Condition panel, type condition name and condition type (VAL, LST, CMP, or RNG) and press Enter to display Edit Field Condition Details panelIn the Edit Field Condition Details panel, type the appropriate condition details like value, range etc.

Page 76: 010-Cool2e Trg Ppt

Op: SYNGXM QPADEV0004 22/08/97 16:11:55 EDIT FIELD CONDITION DETAILS GXMMDL Field name . . . . . : Credit status Attr: STS Mode: *ADD Length of file . . . : 1 on display. . : 4

Condition. . . . . . : Blue chip Type . . . . . . . . : VAL

File value Display value Status value A A1

F3=Exit F8=Change name F20=Narrative

Data ModelingCOOL:2E Data Model

Page 77: 010-Cool2e Trg Ppt

Building Access PathsIntroduction

COOL:2E creates default access paths (PHY, RTV & UPD) when a file is definedAdditional access paths may be createdCOOL:2E access paths are implemented as one or more objectsAccess path defines a physical file or the logical view of that fileAccess path can be used to define order, column selection & record selection

Page 78: 010-Cool2e Trg Ppt

Six types of Access PathsPhysical (PHY) Update (UPD)Retrieval (RTV)Resequence (RSQ)Query (QRY)Span (SPN)

Building Access PathsIntroduction

Page 79: 010-Cool2e Trg Ppt

Building Access PathsPhysical (PHY) Access Path

•Single format file containing fields derived from resolution of all relations on the file.

Not keyedNo virtual fieldsCreated automatically for every REF/CPT fileNot referenced directly by functionsNo additional PHY access paths allowed for a fileCreated if a PF is retrieved through assimilation

Page 80: 010-Cool2e Trg Ppt

Building Access PathsUpdate (UPD) Access Path

•Uniquely keyed, single format access path which is used by functions for updation

Keyed on the fields that identify the fileNo Virtual fieldsCreated automatically for every REF/CPT fileAdditional UPD access paths may be created with the same key but subset of fields

Page 81: 010-Cool2e Trg Ppt

Building Access PathsRetrieval (RTV) Access Path

•Uniquely keyed, single format access path used by functions to retrieve records

Keyed exactly as the UPD access pathAllows virtual fieldsCreated automatically for every REF/CPT fileAssociated with the UPD access pathNon-key fields can be droppedCan select/omit recordsPossible to define multiple RTV access paths for a given file, but all should have same key fields

Page 82: 010-Cool2e Trg Ppt

Building Access PathsResequence (RSQ) Access Path

•Uniquely or non-uniquely keyed single format access path used by functions to retrieve records

Must be created explicitlyDefaults to the keys of the based on fileAllows default keys to be changed which need not be uniqueAllows virtual fieldsAssociated with RTV, which points to a UPDMany RSQ access paths possible for single file

Page 83: 010-Cool2e Trg Ppt

Building Access PathsQuery (QRY) Access Path

•Keyed single format access path used by functions to retrieve records

Must be created explicitlyAllows virtual fields on key & non-key fieldsAvailable only for Print Object/Print File functionsDefaults to the keys of the based on fileAllows default keys to be changedAssociated with RTV, which points to a UPDMany QRY access paths possible for single fileImplemented by OPNQRYF or Dynamic SQL

Page 84: 010-Cool2e Trg Ppt

Building Access PathsSpan (SPN) Access Path

•Keyed multi-format access path•Used by Edit & Display transaction functions to retrieve records from a pair of related files

Must be created explicitlyDefaults to keys of based on filesThese keys can be changedAllows virtual fieldsAssociated with RTV, which points to a UPDMany SPN access paths possible for single file

Page 85: 010-Cool2e Trg Ppt

Building Access PathsAccess Path Summary

# Access Path Type

Real Fields Key Fields Virtual Fields

Virtual Keys

1. PHY x x x

2. UPD Relation x x

3. RTV Relation x

4. RSQ User x

5. QRY User

6. SPN User x

Page 86: 010-Cool2e Trg Ppt

Building Access PathsAdding an Access Path

*DSNR SYNGXMMDL Op: SYNGXM QPADEV0007 11/02/98 12:02:11 EDIT DATABASE RELATIONS SYNGXMMDL => Rel lvl: ? Typ Object Relation Seq Typ Referenced object FIL Customer Known by FLD Customer Code FIL Customer Has FLD Customer Name FIL Customer Has FLD Customer Address 1 FIL Customer Has FLD Customer Address 2 FIL Customer Has FLD Customer Address 3 FIL Customer Has FLD Customer Credit Limit FIL Customer Has FLD Customer Limit Used FIL Inventory Known by FLD Item Code FIL Inventory Has FLD Item Name FIL Inventory Has FLD Item Quantity FIL Sales Order Header Known by FLD Sales Order Number FIL Sales Order Header Refers to FIL Customer FIL Sales Order Header Has FLD Sales Order Date FIL Sales Order Header Has FLD Shipment Date FIL Sales Order Lines Owned by FIL Sales Order Header + SEL: Z(n)-Details, N(n)-Narr, S(n)-Select, E(n)-Entries, V-Virt.fields, F-Funcs

F3=Exit F5=Reload F7=Fields F9=Insert F10=Define obj. F17=Services

Page 87: 010-Cool2e Trg Ppt

Building Access PathsAdding an Access Path

Type Z against any relation on the Edit Database Relations panel for the file and press EnterOn the resulting Edit File Details panel, enter Access Path name and type and press EnterType Z to zoom into the new access path and specify details on the Edit Access Path Details panelType Z on the Edit Access Path Details panel to go to Edit Access Path Format Entries panel

Page 88: 010-Cool2e Trg Ppt

Op: SYNGXM QPADEV0007 11/02/98 12:10:57 EDIT FILE DETAILS SYNGXMMDL File name . . . . . . . . : Customer Attribute . . . . . . . . : REF Field reference file. : *NONE Documentation sequence. . : Source library. . . . : SYNGXMGEN GEN format prefix . . . . : AB Distributed . . . . . : N (Y,N) Assimilated physical. . . : Record not found message. : Customer NF Msgid. : USR0001 Record exists message . . : Customer EX Msgid. : USR0002 ? Typ Access path Source mbr Key Maint Held PHY Physical file UUABREP NONE UPD Update index UUABREL1 UNIQUE IMMED RTV Retrieval index UUABREL0 UNIQUE IMMED RSQ Customer by Name SEL: Z-Details, G/J-Generate, E-STRSEU, D-Delete, N-Narrative, H-Hold/Release, O-Overrides, U-Usage, F-Function refs., L-Locks. F3=Exit F5=Reload F7=Functions F8=Change name F17=Services F20=Narrative

Building Access PathsAdding an Access Path

Page 89: 010-Cool2e Trg Ppt

Op: SYNGXM QPADEV0007 11/02/98 12:17:29 EDIT ACCESS PATH DETAILS SYNGXMMDL File name . . . . . . . . : Customer Attribute . : REF Access path name. . . . . : Customer by Name Type. . . . : RSQ Unique key. . . . . . . . : (Y, blank) or Duplicate sequence . . : F (F-FIFO, L-LIFO, Maintenance . . . . . . . : I (I-IMMED, D-DLY, R-REBLD) Alternate collating table : Allow select/omit . . . . : (S-Static, D-Dynamic, ' '-None) Generation mode . . . : M (M-MDLVAL, D-DDS, E-EXP, S-SQL, X-UNX) Source member name . . : UUABREL2 Source member text . . : Customer Customer by Name Format Format text Associated ? Seq name (Based on file) Retrieval access path 1 FABREAO Customer Retrieval index SEL: Z-Acp.entries, R-Acp.relations, S-Select/omit sets, A-Associated Acps. F3=Exit F8=Rename F20=Narrative

Building Access PathsAdding an Access Path

Page 90: 010-Cool2e Trg Ppt

Op: SYNGXM QPADEV0007 11/02/98 12:19:24 EDIT ACCESS PATH FORMAT ENTRIES SYNGXMMDL File name . . . . . . . . : Customer Attribute . : REF Access path name. . . . . : Customer by Name Type. . . . : RSQ Format text . . . . . . . : Customer Based on. . . . . . . . . : Customer Format No . : 1 GEN Key Altcol Ref ? Field Name Type no. Dsc seq cnt Customer Code CDE ABCD K 1 1 Customer Name TXT ABTX A 1 Customer Address 1 TXT ACTX A 1 Customer Address 2 TXT ADTX A 1 Customer Address 3 TXT AETX A 1 Customer Credit Limit VAL AAVA A 1 Customer Limit Used VAL ABVA A 1 SEL: Z-Field details. F3=Exit F7=Relations

Building Access PathsAdding an Access Path

Page 91: 010-Cool2e Trg Ppt

Span (SPN) Access PathA SPN access path can only be specified over files with Owned by or Refers to relationshipsA SPN access path must be created over an owning or referred to filePress F9 on Edit Access Path Details panel to first select the primary format and then the secondary format

Building Access PathsAdding an Access Path

Page 92: 010-Cool2e Trg Ppt

Following may be changed from Edit Access Path Details panelUnique/Duplicate key sequenceAccess Path Maintenance (Immed, Rebld, Dly)Alternate Collating SequenceSelect/Omit CriteriaGeneration Mode (DDS/SQL)Source member name & text

Building Access PathsModifying an Access Path

Page 93: 010-Cool2e Trg Ppt

Building Access PathsArrays

Arrays have a defined layout with each element having the same layoutMust have a defined key that acts as an indexKey is any subset of the fields with a maximum composite key length of 990Sequence of equally keyed elements in a non-unique array is not guaranteedEach key in the composite key acts as a different array dimensionKey can be ascending/descendingFor key sequence, signs are ignored

Page 94: 010-Cool2e Trg Ppt

Building Access PathsArrays

Arrays can be used by the following four functions:CRTOBJ - to add an elementCHGOBJ - to change an elementDLTOBJ - to delete an elementRTVOBJ - to read an element or set of elements

Page 95: 010-Cool2e Trg Ppt

Building Access PathsArrays

FeaturesCan be used to define a set of fields to be used as a parameter entry to a functionArrays are initialized on the first program callSubsequent calls will not clear the array

Page 96: 010-Cool2e Trg Ppt

Adding/Changing/Deleting ArraysEnter *a in the option field or *ARRAYS in the positional field of Edit Database Relations panelEnter Z against *Arrays file in the resulting panel to see a list of arraysType an array name and press EnterType Z against the array name and press Enter to define fieldsType D against an existing array and press Enter to delete

Building Access PathsArrays

Page 97: 010-Cool2e Trg Ppt

Building Access PathsGenerating & Compiling

Generate source members and compile the generated source to produce objects, files & tablesFrom Edit Database Relations panel, press F17 for servicesOn Display Services Menu, type 8 at bottom of screen to display Display All Access Paths panelType J (batch generation) or G (interactive generation) and press Enter

Page 98: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsCOOL:2E FunctionsCOOL:2E Functions

• COOL:2E function is a process that operates on COOL:2E function is a process that operates on files & fieldsfiles & fields

• COOL:2E Functions can be linked to create larger COOL:2E Functions can be linked to create larger processes that become the building blocks of an processes that become the building blocks of an applicationapplication

• Several COOL:2E functions may be implemented in Several COOL:2E functions may be implemented in a single HLL programa single HLL program

Page 99: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsImplementation of FunctionsImplementation of Functions

• COOL:2E functions are implemented in two COOL:2E functions are implemented in two waysways– External External - the function is implemented as a separate - the function is implemented as a separate

HLL programHLL program

– Internal Internal - the function is implemented as source code - the function is implemented as source code inside the calling functioninside the calling function

Page 100: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsCOOL:2E Function TypesCOOL:2E Function Types

• 4 COOL:2E functions types4 COOL:2E functions types– Standard FunctionsStandard Functions

– Built-In FunctionsBuilt-In Functions

– Functions FieldsFunctions Fields

– Message FunctionsMessage Functions

• Standard functions Standard functions – specify the entire programs or subroutinesspecify the entire programs or subroutines

– User-defined processing can be specifiedUser-defined processing can be specified

– Provide building blocks of an applicationProvide building blocks of an application

Page 101: 010-Cool2e Trg Ppt

• Standard FunctionsStandard Functions– Divided into 3 categoriesDivided into 3 categories

• Database FunctionsDatabase Functions

• Device FunctionsDevice Functions

• User FunctionsUser Functions

• Built-in FunctionsBuilt-in Functions– Execute functions like arithmetic operations, string Execute functions like arithmetic operations, string

manipulation, control operations like commitment manipulation, control operations like commitment control & program exitcontrol & program exit

Building ApplicationsBuilding ApplicationsCOOL:2E Function TypesCOOL:2E Function Types

Page 102: 010-Cool2e Trg Ppt

Built-in FunctionsSpecified within action diagramsImplemented as in-line source code within calling functionsThe Built-in functions are

1) Add 2) Commit3) Compute 4) CONCAT -Concatenation5) CVTVAR - Convert Variable6) DIV - Divide 7) DIV WITH REMAINDER8) Exit Program 9) Modulo

Building ApplicationsCOOL:2E Function Types

Page 103: 010-Cool2e Trg Ppt

Built-in FunctionsThe Built-in functions are (contd…)

10) Move 11) Move All12) MULT - Multiply 13) Quit14) RTVCND - Retrieve Condition15) Rollback 16) Set Cursor17) Substring 18) SUB - Subtract

Building ApplicationsCOOL:2E Function Types

Page 104: 010-Cool2e Trg Ppt

Function FieldsA field whose value is not physically stored in the databaseDerived from other fields or filesOne result parameter - the derived fieldVariable number of input parameters used to derive the valueCOOL:2E provides ready-made function fields

1) SUM - Sum 2) MAX - Maximum 3) MIN - Minimum4) CNT - Count 5) DRV - Derived 6) USR - User

Building ApplicationsCOOL:2E Function Types

Page 105: 010-Cool2e Trg Ppt

Building ApplicationsCOOL:2E Function Types

Message FunctionsDefine workstation messagesImplemented using OS/400 message descriptionsSent by a call to a CL subroutineCan make direct references to fields in the data model

Page 106: 010-Cool2e Trg Ppt

Building ApplicationsCOOL:2E Function Types

Message FunctionsThe Message functions are

1) SNDERRMSG - Send Error Message2) SNDINFMSG - Send Information Message3) SNDCMPMSG - Send Complete Message4) SNDSTSMSG - Send Status Message5) RTVMSG - Retrieve Message6) EXCMSG - Execute Message

Page 107: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsStandard FunctionsStandard Functions

• Database FunctionsDatabase Functions– Basic routines for accessing the databaseBasic routines for accessing the database

– Implemented as part of an external functionImplemented as part of an external function

– Can be used in many different functionsCan be used in many different functions

– There are 4 database functionsThere are 4 database functions

1) CRTOBJ - Create Object1) CRTOBJ - Create Object

2) CHGOBJ - Change Object2) CHGOBJ - Change Object

3) DLTOBJ - Delete Object3) DLTOBJ - Delete Object

4) RTVOBJ - Retrieve Object4) RTVOBJ - Retrieve Object

Page 108: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsStandard FunctionsStandard Functions

• Device FunctionsDevice Functions– Used in interactive & report programsUsed in interactive & report programs

– Consist of panel/report design & action diagramConsist of panel/report design & action diagram

– All device functions are external functions except for All device functions are external functions except for PRTOBJ functionPRTOBJ function

– Implemented as programs that operate over databasesImplemented as programs that operate over databases

Page 109: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsStandard FunctionsStandard Functions

• Device Functions (contd…)Device Functions (contd…)– The Device Functions areThe Device Functions are

1) DSPRCD - Display Record1) DSPRCD - Display Record2) DSPRCD2 - Display Record 2 panels2) DSPRCD2 - Display Record 2 panels3) DSPRCD3 - Display Record 3 panels3) DSPRCD3 - Display Record 3 panels4) PMTRCD - Prompt Record4) PMTRCD - Prompt Record5) EDTRCD - Edit Record5) EDTRCD - Edit Record6) EDTRCD2 - Edit Record 2 panels6) EDTRCD2 - Edit Record 2 panels7) EDTRCD3 - Edit Record 3 panels7) EDTRCD3 - Edit Record 3 panels

Page 110: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsStandard FunctionsStandard Functions

• Device Functions (contd…)Device Functions (contd…)– The Device Functions areThe Device Functions are

8) DSPFIL - Display File8) DSPFIL - Display File

9) EDTFIL - Edit File9) EDTFIL - Edit File

10) SELRCD - Select Record10) SELRCD - Select Record

11) DSPTRN - Display Transaction11) DSPTRN - Display Transaction

12) EDTTRN - Edit Transaction12) EDTTRN - Edit Transaction

13) PRTFIL - Print File13) PRTFIL - Print File

14) PRTOBJ - Print Object14) PRTOBJ - Print Object

Page 111: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsStandard FunctionsStandard Functions

• User FunctionsUser Functions– Means of incorporating user programs or subroutines Means of incorporating user programs or subroutines

into COOL:2E generated applicationsinto COOL:2E generated applications

– Processing steps can be specified with action diagrams Processing steps can be specified with action diagrams or user-written HLLor user-written HLL

– Implemented as inline code (internal functions) or call Implemented as inline code (internal functions) or call to programs (external functions)to programs (external functions)

Page 112: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsStandard FunctionsStandard Functions

• User FunctionsUser Functions– The User Functions areThe User Functions are

1) EXCINTFUN - Execute Internal Function1) EXCINTFUN - Execute Internal Function

2) EXCEXTFUN - Execute External Function2) EXCEXTFUN - Execute External Function

3) EXCUSRPGM - Execute User Program3) EXCUSRPGM - Execute User Program

4) EXCUSRSRC - Execute User Source4) EXCUSRSRC - Execute User Source

Page 113: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsBasic Function PropertiesBasic Function Properties

• Function NameFunction Name– up to 25 characters long including embedded blanks & up to 25 characters long including embedded blanks &

must be unique within a filemust be unique within a file

• Function ComponentsFunction Components– Function optionsFunction options

• allow the user to customize function features like allow the user to customize function features like database changes, display features, exit control, database changes, display features, exit control, commitment control, exception routines, generation commitment control, exception routines, generation options & environment optionsoptions & environment options

Page 114: 010-Cool2e Trg Ppt

Building ApplicationsBasic Function Properties

Function ComponentsFunction Parameters

specify the input and output parameters. Parameters are also used to define local variables for the function

Device Designsspecify the visual presentation of the 2 types of devices used by functions: Panels & Reports

Action Diagramsspecify the processing steps for function logic. This is a combination of default COOL:2E supplied and optional user defined processing logic

Page 115: 010-Cool2e Trg Ppt

Building ApplicationsBasic Function Properties

Function class Parameters Device Design

Action Diagrams

Device Functions

Database Functions

User Functions

x

x

x , x1

Messages

Function Fields

x

x

x , x2

Built-In Functions x x

Function Components

Page 116: 010-Cool2e Trg Ppt

Building ApplicationsBasic Function Properties

Default Device Function ProcessingDefault Device functions compile into working programs with default processingAdditional logic required for business processing

Page 117: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsFunctions & Access PathsFunctions & Access Paths

Functions & Access pathsFunctions operating on a file are always attached to it by an access pathFunctions can access many files with access paths based on several filesA generated program can be made up of several functions each accessing a different access pathDefault panel/report formats are derived from the function’s access path

Page 118: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsAdditional ProcessingAdditional Processing

• Automatic additional logic for functionsAutomatic additional logic for functions– Integrity CheckingIntegrity Checking

• Domain integrity checking for allowed values. Domain integrity checking for allowed values. Enforced by fields having same reference file.Enforced by fields having same reference file.

• Referential Integrity Checking to ensure that relations Referential Integrity Checking to ensure that relations specified in the model are satisfiedspecified in the model are satisfied

– Field ValidationField Validation• upper/lower case validationupper/lower case validation• valid name checking valid name checking • validation through a check condition.validation through a check condition.

Page 119: 010-Cool2e Trg Ppt

Building ApplicationsAdditional Processing

Automatic additional logic for functionsLinking Functions

Automatically links certain functions togetherExternal update functions like EDTFIL are automatically linked to database function like CHGOBJ

Building Blocks ApproachFunctions are building blocksBy linking functions together, required functionality can be achieved

Page 120: 010-Cool2e Trg Ppt

Building ApplicationsDefining Functions

Accessing FunctionsDisplay All Functions panel

select option from the Services MenuDisplay File Functions panel

option F on a file in Edit Database Relations panel Shipped Files Fields

COOL:2E shipped files contain the default data like built-in functions, messages etc.Type * in the Object field & DFN in relations field of Edit Database Relations panel to access

Page 121: 010-Cool2e Trg Ppt

Op: SYNTHS QPADEV0004 18/02/98 13:52:40 DISPLAY ALL FUNCTIONS SYNSXT Application area. : Source library: SYNSXTGEN ? File Function Type GEN name Commodity Change Commodity CHGOBJ *N/A Commodity Create Commodity CRTOBJ *N/A Commodity Delete Commodity DLTOBJ *N/A Commodity Edit Commodity EDTFIL SXACEFR Commodity Select Commodity SELRCD SXABSRR Commodity Price Change Commodity Price CHGOBJ *N/A Commodity Price Create Commodity Price CRTOBJ *N/A Commodity Price Delete Commodity Price DLTOBJ *N/A Commodity Price Edit Commodity Price EDTFIL SXAEEFR Commodity Price Select Commodity Price SELRCD SXADSRR SEL: Z-Dtls, P-Parms, N-Narr., F-Action diagram, S-Device Design, T-Structure, A-Acp, G/J-Gen, E-STRSEU(pgm), L-Locks, D-Delete, U-Where used, 3-Doc. F3=Exit F5=Reload

Building ApplicationsDefining Functions

Page 122: 010-Cool2e Trg Ppt

Op: SYNTHS QPADEV0004 18/02/98 13:48:09 EDIT FUNCTIONS SYNSXT File name. . . : Commodity ** 1ST LEVEL ** ? Function Function type Access path Change Commodity Change object Update index Create Commodity Create object Update index Delete Commodity Delete object Update index Edit Commodity Edit file Retrieval index Select Commodity Select record Retrieval index + SEL: Z-Details, P-Parameters, F-Action diagram, S-Device design, N-Narrative, T-Structure, A-Access path, U-Usage, G/J-Generate, D-Delete, C-Copy, L-Lock. F3=Exit F5=Reload F7=File details F9=Add F17=Services

Building ApplicationsDefining Functions

Page 123: 010-Cool2e Trg Ppt

*DSNR SYNSXT Op: SYNTHS QPADEV0004 18/02/98 13:40:46 EDIT DATABASE RELATIONS SYNSXT => * Rel lvl: DFN ? Typ Object Relation Seq Typ Referenced object FIL *Arrays Defined as FIL *Arrays FIL *Built in functions Defined as FIL *Built in functions FIL *Configuration Table Defined as FIL *Configuration Table FIL *Distributed File Defined as FIL *Distributed File FIL *External Data Access API Defined as FIL *External Data Access API FIL *Field attribute types Defined as FIL *Field attribute types FIL *Job data Defined as FIL *Job data FIL *Messages Defined as FIL *Messages FIL *Program data Defined as FIL *Program data FIL *Standard header/footer Defined as FIL *Standard header/footer FIL *COOL:2E reserved pgm data Defined as FIL *COOL:2E reserved pgm data FIL Audit Information Defined as FIL Audit Information FIL Commodity Defined as FIL Commodity FIL Commodity Price Defined as FIL Commodity Price FIL Company Defined as FIL Company + SEL: Z(n)-Details, N(n)-Narr, S(n)-Select, E(n)-Entries, V-Virt.fields, F-Funcs F3=Exit F5=Reload F7=Fields F9=Insert F10=Define obj. F17=Services

Building ApplicationsDefining Functions

Page 124: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsDatabase FunctionsDatabase Functions

• What are Database functions?What are Database functions?– means of performing actions on databasemeans of performing actions on database

– defined as HLL subroutinedefined as HLL subroutine

• 4 Database functions4 Database functions1) CRTOBJ - routine to add a record to a file.1) CRTOBJ - routine to add a record to a file.

2) CHGOBJ - routine to update a record.2) CHGOBJ - routine to update a record.

3) DLTOBJ - routine to delete a record.3) DLTOBJ - routine to delete a record.

4) RTVOBJ - routine to retrieve one or more records.4) RTVOBJ - routine to retrieve one or more records.

Page 125: 010-Cool2e Trg Ppt

• Default versions of CRT, CHG and DLT Default versions of CRT, CHG and DLT database functions are created for all REF & CPT database functions are created for all REF & CPT files.files.

• RTVOBJ must be created if needed.RTVOBJ must be created if needed.

• Additional processing before and after database Additional processing before and after database access may be specified in the action diagram.access may be specified in the action diagram.

Building ApplicationsBuilding ApplicationsDatabase FunctionsDatabase Functions

Page 126: 010-Cool2e Trg Ppt

Function Purpose Access Path CRTOBJ CHGOBJ DLTOBJ

Add a single record Update a single record Delete a single record

UPD UPD UPD

RTVOBJ Read a record or record(s) RTV, RSQ

Building ApplicationsBuilding ApplicationsDatabase FunctionsDatabase Functions

Page 127: 010-Cool2e Trg Ppt

• Array ProcessingArray Processing– Even though arrays are not implemented as database Even though arrays are not implemented as database

files, the 4 database functions can be defined over an files, the 4 database functions can be defined over an array and used.array and used.

– DLTOBJ with no parameter will clear an arrayDLTOBJ with no parameter will clear an array

Building ApplicationsBuilding ApplicationsDatabase FunctionsDatabase Functions

Page 128: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

• What are Device Functions?What are Device Functions?– Interactive panels or reportsInteractive panels or reports

– Panel device functions for interactive user interface Panel device functions for interactive user interface between end user and applicationbetween end user and application

– Report device functions for written presentation of dataReport device functions for written presentation of data

– All device functions except PRTOBJ function are All device functions except PRTOBJ function are implemented as external functionsimplemented as external functions

Page 129: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

• Interactive device design editorInteractive device design editor– Allows defining ofAllows defining of

• field attributesfield attributes

• positioningpositioning

• conditioningconditioning

• user function keysuser function keys

• literalsliterals

– Can be accessed from Can be accessed from Edit FunctionsEdit Functions, , Edit All FunctionsEdit All Functions, , Edit Function DevicesEdit Function Devices, or the , or the Display All FunctionsDisplay All Functions panels panels

Page 130: 010-Cool2e Trg Ppt

• Device Standard Header device functionsDevice Standard Header device functions– Define Screen Format (DFNSCRFMT)Define Screen Format (DFNSCRFMT)

• to define standard screen header and footer for use by other to define standard screen header and footer for use by other functions with attached screen designfunctions with attached screen design

– Define Report Format (DFNRPTFMT)Define Report Format (DFNRPTFMT)• to define standard report header and footer for use by Print to define standard report header and footer for use by Print

File report functionsFile report functions

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 131: 010-Cool2e Trg Ppt

• Single record device functionsSingle record device functions– Prompt Record (PMTRCD)Prompt Record (PMTRCD)

• defines a program to prompt for a list of fields defined by defines a program to prompt for a list of fields defined by a specified access patha specified access path

• validated values can be passed to another functionvalidated values can be passed to another function

– Display Record (DSPRCD)Display Record (DSPRCD)• defines a program to display a single record from a defines a program to display a single record from a

specified database filespecified database file

• If no key is specified, a key panel prompts for a keyIf no key is specified, a key panel prompts for a key

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 132: 010-Cool2e Trg Ppt

• Single record device functions (contd...)Single record device functions (contd...)– Display Record 2 panels (DSPRCD2)Display Record 2 panels (DSPRCD2)

• identical to DSPRCD except that it allows the record identical to DSPRCD except that it allows the record details to extend into 2 device pagesdetails to extend into 2 device pages

– Display Record 3 panels (DSPRCD3)Display Record 3 panels (DSPRCD3)• identical to DSPRCD except that it allows the record identical to DSPRCD except that it allows the record

details to extend into 3 device pagesdetails to extend into 3 device pages

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 133: 010-Cool2e Trg Ppt

• Single record device functions (contd…)Single record device functions (contd…)– Edit Record (EDTRCD)Edit Record (EDTRCD)

• defines a program to maintain (add, change or delete) records one at defines a program to maintain (add, change or delete) records one at a time.a time.

• If no key is specified, a key panel prompts for a key.If no key is specified, a key panel prompts for a key.

– Edit Record 2 panels (EDTRCD2)Edit Record 2 panels (EDTRCD2)• identical to EDTRCD except that it allows the record details to identical to EDTRCD except that it allows the record details to

extend into 2 device pages.extend into 2 device pages.

– Edit Record 3 panels (EDTRCD3)Edit Record 3 panels (EDTRCD3)• identical to EDTRCD except that it allows the record details to identical to EDTRCD except that it allows the record details to

extend into 3 device pages.extend into 3 device pages.

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 134: 010-Cool2e Trg Ppt

• Multiple record device functionsMultiple record device functions– Display File (DSPFIL)Display File (DSPFIL)

• defines a program to display the records in a file many at a defines a program to display the records in a file many at a time, using a subfiletime, using a subfile

• the subfile is loaded one page at a time when the user the subfile is loaded one page at a time when the user presses ROLLUP/F8presses ROLLUP/F8

– Edit File (EDTFIL)Edit File (EDTFIL)• defines a program to maintain the records in a file many at defines a program to maintain the records in a file many at

a time, using a subfilea time, using a subfile• the subfile is loaded one page at a time when the user the subfile is loaded one page at a time when the user

presses ROLLUP/F8.presses ROLLUP/F8.

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 135: 010-Cool2e Trg Ppt

• Multiple record device functions (contd…)Multiple record device functions (contd…)– Select Record (SELRCD)Select Record (SELRCD)

• defines a program to display the records in a file many at defines a program to display the records in a file many at a time, using a subfilea time, using a subfile

• allows the user to select one record which is returned to allows the user to select one record which is returned to the calling programthe calling program

• called from a function that requests a selection list.called from a function that requests a selection list.

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 136: 010-Cool2e Trg Ppt

• Single & multiple record device functionsSingle & multiple record device functions– Display Transaction (DSPTRN)Display Transaction (DSPTRN)

• defines a program to display the records from a selected pair of defines a program to display the records from a selected pair of database filesdatabase files

• the pair must be connected by an the pair must be connected by an Owned byOwned by or or Refers toRefers to relationrelation

– Edit Transaction (EDTTRN)Edit Transaction (EDTTRN)• defines a program to maintain the records from a selected pair of defines a program to maintain the records from a selected pair of

database filesdatabase files• the pair must be connected by an the pair must be connected by an Owned byOwned by or or Refers toRefers to

relation.relation.

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 137: 010-Cool2e Trg Ppt

• Printer device functionsPrinter device functions– Print File (PRTFIL)Print File (PRTFIL)

• defines a program to print records from a specified access defines a program to print records from a specified access path.path.

– Print Object (PRTOBJ)Print Object (PRTOBJ)• defines a particular report fragment which will print the defines a particular report fragment which will print the

records from a specified access path at any point within a records from a specified access path at any point within a PRTFIL functionPRTFIL function

• can be embedded within other PRTOBJ functions.can be embedded within other PRTOBJ functions.

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 138: 010-Cool2e Trg Ppt

• Standard Features of Device FunctionsStandard Features of Device Functions– Diagnostic messagesDiagnostic messages

• message sent to program’s message queuemessage sent to program’s message queue• message subfile to show the pending messagesmessage subfile to show the pending messages• allows second level text and substitution variablesallows second level text and substitution variables

– Highlighting of ErrorsHighlighting of Errors• a field in error is highlighted in reverse imagea field in error is highlighted in reverse image• cursor is positioned at first such fieldcursor is positioned at first such field

– On-line Help TextOn-line Help Text• pressing pressing HELP HELP key or key or F1 F1 key results in call to a help key results in call to a help

programprogram

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 139: 010-Cool2e Trg Ppt

• Standard Features of Device FunctionsStandard Features of Device Functions– Print KeyPrint Key

• print key is enabled to allow panel printsprint key is enabled to allow panel prints

• print file is controlled by print file is controlled by YPKYVNM YPKYVNM model valuemodel value

– Selection ColumnsSelection Columns• Selection subfiles have selection column on the leftSelection subfiles have selection column on the left

– Function key UsageFunction key Usage• CUA standards are followed e.g. CUA standards are followed e.g. F3F3 is exit is exit

– Positioning facilitiesPositioning facilities• subfile programs have a positioning fieldsubfile programs have a positioning field

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 140: 010-Cool2e Trg Ppt

• Standard Features of Device FunctionsStandard Features of Device Functions– Single Page Subfile load upSingle Page Subfile load up

• subfiles are loaded on demand basissubfiles are loaded on demand basis• only when only when F8 F8 or or ROLLUP ROLLUP keys are pressedkeys are pressed

– Concurrency checking and record lockingConcurrency checking and record locking• updation programs do not hold locks upon database updation programs do not hold locks upon database

while changes are entered or validatedwhile changes are entered or validated• includes logic at the point of update to check for record includes logic at the point of update to check for record

lock by other userslock by other users– Overflow HandlingOverflow Handling

• report functions include handling of page overflowreport functions include handling of page overflow

Building ApplicationsBuilding ApplicationsDevice FunctionsDevice Functions

Page 141: 010-Cool2e Trg Ppt

• What are User Functions?What are User Functions?– means of implementing additional user processing means of implementing additional user processing

within an existing function or as an independent within an existing function or as an independent implementation along with an existing functionimplementation along with an existing function

– e.g. batch functions for updating database having no e.g. batch functions for updating database having no associated device or a user-written HLL program associated device or a user-written HLL program which has to be integrated to COOL:2E generated which has to be integrated to COOL:2E generated applicationapplication

Building ApplicationsBuilding ApplicationsUser FunctionsUser Functions

Page 142: 010-Cool2e Trg Ppt

• Two types of User FunctionsTwo types of User Functions– Free-Form User functionsFree-Form User functions

• specify actions that can be used within a function or specify actions that can be used within a function or called from a functioncalled from a function

• processing logic is defined through the Action Diagram processing logic is defined through the Action Diagram editoreditor

– User Coded User functionsUser Coded User functions• functions are user-written in HLLfunctions are user-written in HLL

• can be called or embeddedcan be called or embedded

Building ApplicationsBuilding ApplicationsUser FunctionsUser Functions

Page 143: 010-Cool2e Trg Ppt

• Free-Form User FunctionsFree-Form User Functions– Execute Internal Function (EXCINTFUN)Execute Internal Function (EXCINTFUN)

• allows specification of a section of an action diagram for allows specification of a section of an action diagram for repeated use in other functionsrepeated use in other functions

• implemented as Internal functionimplemented as Internal function

– Execute External Function (EXCEXTFUN)Execute External Function (EXCEXTFUN)• allows specification of an HLL program using an action allows specification of an HLL program using an action

diagramdiagram

• implemented as External functionimplemented as External function

Building ApplicationsBuilding ApplicationsUser FunctionsUser Functions

Page 144: 010-Cool2e Trg Ppt

• User Coded User FunctionsUser Coded User Functions– Execute User Program (EXCUSRPGM)Execute User Program (EXCUSRPGM)

• describes interface to a user written HLL programdescribes interface to a user written HLL program

• parameters can be specified on the callparameters can be specified on the call

– Execute User Source (EXCUSRSRC)Execute User Source (EXCUSRSRC)• specifies that user-written HLL code be included specifies that user-written HLL code be included

within the HLL source generated by COOL:2E for an within the HLL source generated by COOL:2E for an external functionexternal function

Building ApplicationsBuilding ApplicationsUser FunctionsUser Functions

Page 145: 010-Cool2e Trg Ppt

• What are Message Functions?What are Message Functions?– means of defining messages of various types, means of defining messages of various types,

specifying different message files for the message, specifying different message files for the message, specifying substitution variables and changing message specifying substitution variables and changing message identifiersidentifiers

– can be accessed by looking at functions of can be accessed by looking at functions of *MESSAGES*MESSAGES file file

Building ApplicationsBuilding ApplicationsMessage FunctionsMessage Functions

Page 146: 010-Cool2e Trg Ppt

• 6 Message Functions6 Message Functions– Send Error Message (SNDERRMSG)Send Error Message (SNDERRMSG)

• error message to be sent to a calling functionerror message to be sent to a calling function• used for diagnostic messages arising from user used for diagnostic messages arising from user

validationvalidation– Send Information Message (SNDINFMSG)Send Information Message (SNDINFMSG)

• information message be sent to the message queue of information message be sent to the message queue of the calling programthe calling program

– Send Completion Message (SNDCMPMSG)Send Completion Message (SNDCMPMSG)• completion message to be sent to a calling functioncompletion message to be sent to a calling function

Building ApplicationsBuilding ApplicationsMessage FunctionsMessage Functions

Page 147: 010-Cool2e Trg Ppt

• 6 Message Functions6 Message Functions– Send Status Message (SNDSTSMSG)Send Status Message (SNDSTSMSG)

• status message to be sent to a calling functionstatus message to be sent to a calling function

• informs of the progress of a long-running processinforms of the progress of a long-running process

– Retrieve Message (RTVMSG)Retrieve Message (RTVMSG)• to retrieve message text from message in message fileto retrieve message text from message in message file

– Execute Message (EXCMSG)Execute Message (EXCMSG)• specifies that a request message has to be executedspecifies that a request message has to be executed

Building ApplicationsBuilding ApplicationsMessage FunctionsMessage Functions

Page 148: 010-Cool2e Trg Ppt

• What are Function Fields?What are Function Fields?– Special types of fields that can be used in device Special types of fields that can be used in device

designs and action diagramsdesigns and action diagrams

– based on other fieldsbased on other fields

– processing can be specified for a function fieldprocessing can be specified for a function field

Building ApplicationsBuilding ApplicationsFunction FieldsFunction Fields

Page 149: 010-Cool2e Trg Ppt

• Function field UsagesFunction field Usages– Sum (SUM)Sum (SUM)

• contains sum of values of another fieldcontains sum of values of another field• Input Parameter is the field whose sum is to be calculatedInput Parameter is the field whose sum is to be calculated• Result Parameter is the field containing the sumResult Parameter is the field containing the sum

– Count (CNT)Count (CNT)• defines count of a set of records in EDTTRN, DSPTRN, defines count of a set of records in EDTTRN, DSPTRN,

PRTFIL & PRTOBJ functionsPRTFIL & PRTOBJ functions• Input Parameter is field on the detail or subfile recordInput Parameter is field on the detail or subfile record• Output field contains the countOutput field contains the count

Building ApplicationsBuilding ApplicationsFunction FieldsFunction Fields

Page 150: 010-Cool2e Trg Ppt

• Function field UsagesFunction field Usages– Maximum (MAX)Maximum (MAX)

• contains the highest value of another fieldcontains the highest value of another field• Input Parameter is the field whose maximum is to be calculatedInput Parameter is the field whose maximum is to be calculated• Result Parameter is the field containing the maximumResult Parameter is the field containing the maximum

– Minimum (MIN)Minimum (MIN)• contains the lowest value of another fieldcontains the lowest value of another field• Input Parameter is the field whose minimum is to be calculatedInput Parameter is the field whose minimum is to be calculated• Result Parameter is the field containing the minimumResult Parameter is the field containing the minimum

Building ApplicationsBuilding ApplicationsFunction FieldsFunction Fields

Page 151: 010-Cool2e Trg Ppt

• Function field UsagesFunction field Usages– Derive (DRV)Derive (DRV)

• performs user-defined action to derive resultperforms user-defined action to derive result• action diagram is attached where processing can be action diagram is attached where processing can be

specified for deriving the resultspecified for deriving the result• Multiple input Parameters can be specifiedMultiple input Parameters can be specified• One Resulting ParameterOne Resulting Parameter

– User (USR)User (USR)• reserved for work fields needed in device design or action reserved for work fields needed in device design or action

diagram e.g. menu options, command stringdiagram e.g. menu options, command string• can be input-capable or output onlycan be input-capable or output only

Building ApplicationsBuilding ApplicationsFunction FieldsFunction Fields

Page 152: 010-Cool2e Trg Ppt

• What are Function Options?What are Function Options?– Function options control the features of functionsFunction options control the features of functions

– Function Options forFunction Options for• Database ChangesDatabase Changes

• Display FeaturesDisplay Features

• Exit ControlExit Control

• Commitment ControlCommitment Control

• Exception RoutineException Routine

• GenerationGeneration

• EnvironmentEnvironment

Building ApplicationsBuilding ApplicationsFunction OptionsFunction Options

Page 153: 010-Cool2e Trg Ppt

• Database Changes Function optionsDatabase Changes Function options– determine if program allows add, change or delete capabilities or a determine if program allows add, change or delete capabilities or a

combinationcombination

• Display Features Function optionsDisplay Features Function options– Confirmation - function prompts for confirmationConfirmation - function prompts for confirmation

– Initial value for ConfirmationInitial value for Confirmation

– Standard Header/Footer selectionStandard Header/Footer selection

– Subfile Selection ColumnSubfile Selection Column

– Dynamic Program Mode - function determines initial mode of Dynamic Program Mode - function determines initial mode of executionexecution

Building ApplicationsBuilding ApplicationsFunction OptionsFunction Options

Page 154: 010-Cool2e Trg Ppt

• Display Features Function optionsDisplay Features Function options– Exit after Add - for EDTRCD functionsExit after Add - for EDTRCD functions

– Repeat Prompt - whether prompt (PMTRCD) to be redisplayed Repeat Prompt - whether prompt (PMTRCD) to be redisplayed after user processingafter user processing

– Bypass Key Screen - whether key screen to be displayed before Bypass Key Screen - whether key screen to be displayed before displaying detail screendisplaying detail screen

– Post Confirm Pass - to re-read database file and update subfile Post Confirm Pass - to re-read database file and update subfile after confirmationafter confirmation

– Send All Messages - whether message subfile at bottom of panel Send All Messages - whether message subfile at bottom of panel for first or all errorsfor first or all errors

Building ApplicationsBuilding ApplicationsFunction OptionsFunction Options

Page 155: 010-Cool2e Trg Ppt

• Exit ControlExit Control– Determines execution characterstics of programsDetermines execution characterstics of programs

– Closedown Program - whether program will terminate Closedown Program - whether program will terminate or remain invoked but inactiveor remain invoked but inactive

– Reclaim Resources - whether RCLRSC command will Reclaim Resources - whether RCLRSC command will be invoked after program callbe invoked after program call

– CopyBack Messages - whether pending messages in CopyBack Messages - whether pending messages in program message que to be copied to program message program message que to be copied to program message queue of calling programqueue of calling program

Building ApplicationsBuilding ApplicationsFunction OptionsFunction Options

Page 156: 010-Cool2e Trg Ppt

• Commitment ControlCommitment Control– Determines commitment control regime for a program Determines commitment control regime for a program

namely MASTER, SLAVE or NONEnamely MASTER, SLAVE or NONE

– MASTER - program contains commit points and the MASTER - program contains commit points and the program ensures that commitment is activeprogram ensures that commitment is active

– SLAVE - program contains commit points but the program SLAVE - program contains commit points but the program does not ensure that commitment is activedoes not ensure that commitment is active

– NONE - program does not run under commitment controlNONE - program does not run under commitment control

Building ApplicationsBuilding ApplicationsFunction OptionsFunction Options

Page 157: 010-Cool2e Trg Ppt

• Exception RoutineException Routine– Generate Exception Routine - specifies whether code for Generate Exception Routine - specifies whether code for

exception routine (*PSSR) should be generatedexception routine (*PSSR) should be generated

• Generation OptionsGeneration Options– Generation Mode - specifies database access used for Generation Mode - specifies database access used for

functionsfunctions

D D for DDS access method; for DDS access method; S S for SQL access methodfor SQL access method

E E for External Source Format; for External Source Format; M M for model valuefor model value

AA if generation value of primary path to be used if generation value of primary path to be used

Building ApplicationsBuilding ApplicationsFunction OptionsFunction Options

Page 158: 010-Cool2e Trg Ppt

• Generation OptionsGeneration Options– Generate Help - specifies whether help is generatedGenerate Help - specifies whether help is generated

– Screen Text ConstantsScreen Text Constants

L L results in panel literals being hard coded in sourceresults in panel literals being hard coded in source

M M results in panel literals to be stored in message fileresults in panel literals to be stored in message file

D D means model value to be usedmeans model value to be used

Building ApplicationsBuilding ApplicationsFunction OptionsFunction Options

Page 159: 010-Cool2e Trg Ppt

• What are Function Parameters?What are Function Parameters?– Specifies the fields passed between functionsSpecifies the fields passed between functions

• Basic properties of function parametersBasic properties of function parameters– NameName

– Usage TypeUsage Type• Input only, Output only, Both, NeitherInput only, Output only, Both, Neither

– Flag Error StatusFlag Error Status• specifies error in the called functionspecifies error in the called function

• allowed in SNDERRMSG, EXCMSG or any external functionallowed in SNDERRMSG, EXCMSG or any external function

Building ApplicationsBuilding ApplicationsFunction ParametersFunction Parameters

Page 160: 010-Cool2e Trg Ppt

• Neither parametersNeither parameters– No value passed or returned for a parameterNo value passed or returned for a parameter– Neither parameters are available for use as local variables Neither parameters are available for use as local variables

within the functionwithin the function

• Default parameters of functionsDefault parameters of functionsFunctionFunction default parametersdefault parameters usageusageCHGOBJCHGOBJ all fields of update indexall fields of update index I ICRTOBJCRTOBJ all fields of update indexall fields of update index I IDLTOBJDLTOBJ key fields of update indexkey fields of update index I IRTVOBJRTVOBJ key fields of attached acc. Pathkey fields of attached acc. Path I ISELRCDSELRCD key fields of update indexkey fields of update index B B

Building ApplicationsBuilding ApplicationsFunction ParametersFunction Parameters

Page 161: 010-Cool2e Trg Ppt

• Return Code ParameterReturn Code Parameter– Informs the calling program of the state under which Informs the calling program of the state under which

called program was exitedcalled program was exited

– All functions except EXCUSRPGM & EXCUSRSRC All functions except EXCUSRPGM & EXCUSRSRC have implicit return code parameter as first parameterhave implicit return code parameter as first parameter

– The values of Return Code parameter areThe values of Return Code parameter are

*DBF error; *Normal; *Record already exists;*DBF error; *Normal; *Record already exists;

*Record does not exist; *Substring error;*Record does not exist; *Substring error;

*User Quit requested*User Quit requested

Building ApplicationsBuilding ApplicationsFunction ParametersFunction Parameters

Page 162: 010-Cool2e Trg Ppt

• Parameter RolesParameter Roles– Specifies the use of parameter in functionSpecifies the use of parameter in function

– Following are the parameter rolesFollowing are the parameter rolesMap Parameter Map Parameter - the parameter is added automatically to the - the parameter is added automatically to the

corresponding field on the receiving function’s panel design. Map corresponding field on the receiving function’s panel design. Map Neither parameter adds field to panel design without passing a valueNeither parameter adds field to panel design without passing a value

Restrictor ParameterRestrictor Parameter - the parameter restricts the pupation of field by - the parameter restricts the pupation of field by making it input only fieldmaking it input only field

Positional ParameterPositional Parameter - the parameter is used to position a function to - the parameter is used to position a function to start reading records from a particular recordstart reading records from a particular record

Building ApplicationsBuilding ApplicationsFunction ParametersFunction Parameters

Page 163: 010-Cool2e Trg Ppt

• Parameter RolesParameter RolesVary Parameter Vary Parameter - the parameter can have a varying length. Useful - the parameter can have a varying length. Useful

for interfacing with user-written functionsfor interfacing with user-written functions

• Defining Function ParametersDefining Function Parameters– in the in the Edit Functions Edit Functions panel, type panel, type P P next to the selected functionnext to the selected function

– specify a field or a set of fields in specify a field or a set of fields in Edit Function ParametersEdit Function Parameters panelpanel

– Type Type ZZ for a parameter to specify Role/Usage through for a parameter to specify Role/Usage through Edit Edit Function Parameter Details Function Parameter Details panelpanel

Building ApplicationsBuilding ApplicationsFunction ParametersFunction Parameters

Page 164: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsFunction ParametersFunction Parameters

Op: SYNTHS QPADEV0007 19/02/98 10:38:58 EDIT FUNCTION PARAMETERS SYNSXT Function name. . : Delete Commodity Type : Delete object Received by file : Commodity Acpth: Update index Passed ? File/*FIELD Access path/Field as Seq Commodity Update index KEY | Values FLD: One parameter per field RCD: One parameter for all fields KEY: One parameter for key fields only SEL: Z-Details (field selection). F3=Exit F5=Reload

Page 165: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsFunction ParametersFunction Parameters

Op: SYNTHS QPADEV0007 19/02/98 10:40:20 EDIT FUNCTION PARAMETER DETAILS SYNSXT Function name. . : Delete Commodity Type : Delete object Received by file : Commodity Acpth: Update index Parameter (file) : Commodity Passed as: KEY ? Field Usage Role Commodity Code I SEL: Usage: I-Input, O-Output, B-Both, N-Neither, D-Drop. Role: R-Restrict, M-Map, V-Vary length, P-Position. F3=Exit

Page 166: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsDevice DesignsDevice Designs

• What are Device Designs?What are Device Designs?– Specifies the layouts of fields and constants on the panels or Specifies the layouts of fields and constants on the panels or

report designs for a functionreport designs for a function

• Basic properties of Device DesignsBasic properties of Device Designs– Device Design StandardDevice Design Standard

• depends on the function type and associated standard header/footer depends on the function type and associated standard header/footer functionsfunctions

– Device Design FormatDevice Design Format• Formats are created from the fields of the based-on access path and Formats are created from the fields of the based-on access path and

their associated texttheir associated text

Page 167: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsDevice DesignsDevice Designs

• Basic properties of Device DesignsBasic properties of Device Designs– Device Design FieldDevice Design Field

• fields come from access path, function parameters and fields come from access path, function parameters and Header/FooterHeader/Footer

• Editing Device DesignEditing Device Design– in the in the Edit Functions Edit Functions panel, type panel, type S S next to the selected function to next to the selected function to

display the device designdisplay the device design

– use function keys to edit the device designuse function keys to edit the device design• F1 F1 moves the field 40 columnsmoves the field 40 columns

• F3 F3 exits the panelexits the panel

Page 168: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsDevice DesignsDevice Designs

• Editing Device DesignEditing Device Design– use function keys to edit the device designuse function keys to edit the device design

• F4 F4 move the field 40 columns to the rightmove the field 40 columns to the right• F5 F5 edits device format detailsedits device format details• F6 F6 cancels the pending operationscancels the pending operations• F7 F7 displays Edit Device Design Format Relationsdisplays Edit Device Design Format Relations• F8 F8 moves the selected field to the cursor positionmoves the selected field to the cursor position• F9 F9 wraps text onto next linewraps text onto next line• F10 F10 moves text one column to the rightmoves text one column to the right• F11 F11 removes the lineremoves the line• F12 F12 aligns text below cursor positionaligns text below cursor position

Page 169: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsDevice DesignsDevice Designs

• Editing Device DesignEditing Device Design– use function keys to edit the device designuse function keys to edit the device design

• F13 F13 fast exits the panelfast exits the panel• F15 F15 moves panel window to left marginmoves panel window to left margin• F16 F16 moves window to right marginmoves window to right margin• F17 F17 displays a list of device formatsdisplays a list of device formats• F18 F18 displays the Edit Field Attributes paneldisplays the Edit Field Attributes panel• F19 F19 adds new function field to the deviceadds new function field to the device• F20 F20 edits function field on the deviceedits function field on the device• F21 F21 adds a line above cursoradds a line above cursor• F22 F22 moves text one column to the leftmoves text one column to the left

Page 170: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsDevice DesignsDevice Designs

• Editing Device DesignEditing Device Design– use function keys to edit the device designuse function keys to edit the device design

• F23 F23 adds constant field to the device designadds constant field to the device design

• F25 F25 aligns all fields under the cursor positionaligns all fields under the cursor position

Page 171: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsAction DiagramsAction Diagrams

• What are Action Diagrams?What are Action Diagrams?– Action Diagrams record the basic constructs that make Action Diagrams record the basic constructs that make

up a procedureup a procedure

– the procedural steps encompass a list of actions like call the procedural steps encompass a list of actions like call to another function or a low-level built-in functionto another function or a low-level built-in function

• Displaying Action Diagram of a functionDisplaying Action Diagram of a function– Type Type F F next to the selected function in the next to the selected function in the Edit Edit

FunctionsFunctions panel panel

Page 172: 010-Cool2e Trg Ppt

Building ApplicationsBuilding ApplicationsAction DiagramsAction Diagrams

EDIT ACTION DIAGRAM Edit SYNSXT Commodity FIND=> Edit Commodity > Edit Commodity .-- . ...Initialize <-- . .=REPEAT WHILE . |-*ALWAYS . | ...Load first subfile page <-- . | PGM.*Reload subfile = CND.*NO . | > Conduct screen conversation . | .=REPEAT WHILE . | |-PGM.*Reload subfile is *NO . | | Display screen . | | ...Process response <-- . | '-ENDWHILE . '-ENDWHILE . ...Closedown <-- '-- F3=Exit F5=User points F6=Cancel pending moves F7=Forward F8=Backward F9=Edit parameters F15=Open Functions F16=Toggle Change Date F24=More keys

Page 173: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

User PointsCOOL:2E/2 functions except EXCUSRSRC & EXCUSRPGM have default action diagramsome portions of default action diagrams which depict essential processing are not alterableareas which can be modified and where business logic can be entered are called User PointsPress F5 on the action diagram to display user points for the function

Page 174: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

EDIT ACTION DIAGRAM Edit SYNSXT Commodity FIND=> Edit Commodity .............................................................. > Edit : ACTION DIAGRAM EXIT POINTS F3=Exit SEL:X,Z-Select. : .-- : USER: Initialize program : . ...I : USER: Initialize subfile header : <-- . .=RE : USER: Initialize subfile record (existing record) : . |-*A : USER: Initialize subfile record (new record) : . | .. : CALC: Subfile control function fields : <-- . | PG : USER: Validate subfile control : . | > : USER: Validate subfile record fields : . | .= : CALC: Subfile record function fields : . | |- : USER: Validate subfile record relations + : . | | :............................................................: . | | ...Process response <-- . | '-ENDWHILE . '-ENDWHILE . ...Closedown <-- '-- F3=Exit F5=User points F6=Cancel pending moves F7=Forward F8=Backward F9=Edit parameters F15=Open Functions F16=Toggle Change Date F24=More keys

Page 175: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Action Diagram ConstructsSequential - specify a list of actions or other constructs that are executed in a sequential order. Denoted by brackets enclosing dotted lines

___: ….: ….:___

Page 176: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Action Diagram ConstructsConditional - actions are conditionally executed and are called CASE blocks. Denoted by CASE and ENDCASE statements

_CASE

: ….

: ….

:_ ENDCASE

Page 177: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Action Diagram ConstructsIterative - represents repetitive logic. Denoted by REPEAT WHILE and ENDWHILE statements

_ REPEAT WHILE: ….: ….:_ ENDWHILE

Page 178: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Contextinstances of a field that are available for use at a particular processing stepDatabase Contexts - instances of same database field available in more than one fileDevice Contexts - instances of same device field available in more than one formatLiteral Contexts - instances of field available from literals like condition etc.System Contexts - instances of fields available from various system values

Page 179: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

ContextFunction Contexts - instances of field available from function attributes like parameter

Database ContextsDB1 - fields are in the first or the only format of the based-on access pathDB2 - fields are from second format of the based on access path e.g. in SPN access path

Page 180: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Device ContextsKEY - fields are from the key panel display in case of EDTRCD or DSPRCD functionsDTL - fields are from the first panel of EDTRCDn or DSPRCDn functions2ND - fields are from the second panel of EDTRCDn or DSPRCDn functions3RD - fields are from the third panel of EDTRCDn or DSPRCDn functions

Page 181: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Device ContextsCTL - fields are from the subfile control record formatRCD - fields are from the subfile record formatCUR - fields are from the current report format in PRTOBJ and PRTFIL functionsNXT - fields are from the next active report format in PRTOBJ and PRTFIL functions

Page 182: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Literal ContextsCND - particular field condition is specified as a valueCON - constant context contains a literal value for non-status type fields

System ContextsJOB - contains system fields having execution time information of the job e.g. *USER, *JOBPGM - contains system fields that control the execution like *Program Mode, *Return Code

Page 183: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Function ContextsPAR - parameter fields as field valuesWRK - program variables not declared as any context as field values e.g. any field in data dictionary

Action Diagram Editorallows modification of Action Diagramline commands allow the modification

Page 184: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Action Diagram EditorLine Commands

* Activate/Inactivate construct (Comment out) ** Place block Activate/Inactivate boundary A Place copied or moved construct after this line B Place copied or moved construct before this line C Copy construct to a point indicated by 'A' or 'B' CC Place block Copy boundary D Delete this construct DD Place block Delete boundary F Edit action or condition details for line FF Edit action parameters H Hide construct I+ Insert *ADD built-in function I+F Insert and Prompt *ADD built-in function I* Insert Comment I*F Insert and Prompt Comment

Page 185: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Action Diagram EditorLine Commands

I- Insert *SUB built-in function I-F Insert and Prompt *SUB built-in function I= Insert *MOVE built-in function I=A Insert and Prompt *MOVE ALL built in function I=F Insert and Prompt *MOVE built-in fucntion IA Insert Action IAF Insert and prompt Action IC Insert Case condition ICF Insert and Prompt Case condition II Insert Iteration IIF Insert and Prompt Iteration IM Insert Message function IMF Insert and Prompt Message function IO Insert *OTHERWISE condition IOF Insert and prompt *OTHERWISE condition

Page 186: 010-Cool2e Trg Ppt

Building ApplicationsAction Diagrams

Action Diagram EditorLine Commands

IS Insert Sequence ISF Insert and Prompt Sequence IX Insert New condition within Case IXF Insert and Prompt New condition within Case M Move construct to a point indicated by 'A' or 'B' MM Place block Move boundary NA Copy to notepad & append to contents of notepad NAA Place block notepad append boundary NI Insert entire contents of notepad after this line NR Copy to notepad & replace contents of notepad NRR Place block notepad replace boundary S Show construct T Return to top level of action diagram U Unzoom out of construct to previous construct Z Zoom into construct

Page 187: 010-Cool2e Trg Ppt

Generating ApplicationsCOOL:2E Generator

GenerationData Model is translated into either DDS sources or SQL collections

Access Paths into Physical and Logical filesCOOL:2E functions are translated into HLL programs - COBOL, RPG or bothDevice designs attached to functions are generated as DDS sources of Display and Printer filesCompilation of generated code is automatically submitted

Page 188: 010-Cool2e Trg Ppt

Generating ApplicationsCOOL:2E Generator

Generating Codefrom the Services Menu, take option for displaying all access paths or all functionsTake option J(batch) or G(online) for the item that has to be generated

Page 189: 010-Cool2e Trg Ppt

COOL:2E/1E UtilitiesMenus

COOL:2E/1E Menusdynamic menu systemremoves the need of individual OS/400 display file for each application menuMenus stored in special form and displayed using COOL:2E commands YWRKMNU & YGOMenus are stored in a database file memberYDSNMNU is the default menu file supplied with COOL:2E/1E

Page 190: 010-Cool2e Trg Ppt

COOL:2E/1E UtilitiesMenus

COOL:2E/1E MenusYCRTDSNF command can create a new design fileYADDDSNFM adds new member to design file2 types of COOL:2E menus

Single optionMultiple option