AS/400 Group NOIDA

TATA CONSULTANCY SERVICES

COOL:2E Training

1

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

TATA CONSULTANCY SERVICES

Introduction to COOL:2E
What is COOL:2E?
» An application development tool » Allows efficient design, development, implementation & maintenance of application software » Better than third generation development methods » Knowledge of programming language not required » Platform independent application design

TATA CONSULTANCY SERVICES

COOL:2E Training

3

Introduction to COOL:2E COOL:2E Objectives » Design closer to user requirements » Higher quality applications » Ease of maintenance and enhancement » Language independent design » Applications that make effective use of platform » Increased Productivity TATA CONSULTANCY SERVICES COOL:2E Training 4 .

IBM mainframes. RS/6000 TATA CONSULTANCY SERVICES COOL:2E Training 5 .Introduction to COOL:2E COOL:2E Design Principles Implementation independence » Application design developed as high level business logic and design » Applications stored as COOL:2E design model » Same application design can generate application to run on AS/400.

) Data-driven Design » Application design starts with the identification of business entities and their relationship » Entity-Relationship modeling is used to create the COOL:2E data model » Functions for the end user are subsequently built on the data model TATA CONSULTANCY SERVICES COOL:2E Training 6 .Introduction to COOL:2E COOL:2E Design Principles (contd..

) Object-based Design » Objects are database entities » Actions are COOL:2E functions » Actions and Objects are defined once and reused. TATA CONSULTANCY SERVICES COOL:2E Training 7 .Introduction to COOL:2E COOL:2E Design Principles (contd..

Primary access paths. function flows and device designs TATA CONSULTANCY SERVICES COOL:2E Training 8 . COOL:2E Data model. pragmatic approach to Application Development Rapid Prototyping Methodology » Analyze ± System analysis. E-R diagram.Introduction to COOL:2E Application Development COOL:2E Rapid Prototyping Methodology (RPM) is a data-driven.

update design. action diagrams.) » Design ± Prototype application.Introduction to COOL:2E Application Development Rapid Prototyping Methodology (contd.. continue functions definition.. system test and user acceptance test TATA CONSULTANCY SERVICES COOL:2E Training 9 . complete database design » Construct ± Generate final version of application and complete unit testing » Implement ± Complete integration test. review with user.

Introduction to COOL:2E Application Maintenance » Change design model as necessary » Update the function design for above changes » Regenerate dependant elements TATA CONSULTANCY SERVICES COOL:2E Training 10 .

Introduction to COOL:2E COOL:2E Products » COOL:2E Application development tool for AS/400 Includes COOL:2E/1E » COOL:2E/2G Provides PC based GUI for COOL:2E » COOL:2E/CSG (Client Server Generator) Option to COOL:2E which allows distributed functionality on multiple platforms TATA CONSULTANCY SERVICES COOL:2E Training 11 .

Introduction to COOL:2E COOL:2E Features » Entity Relationship Specification ± Automatic creation of a data dictionary ± Free format text to describe any design object ± Automatic documentation of the design model ± Specification of domain checks » Access Paths ± Logical views to support functions ± Retrieval of existing DB2/400 descriptions (assimilation) TATA CONSULTANCY SERVICES COOL:2E Training 12 .

Introduction to COOL:2E COOL:2E Features (contd«) » Functions ± Auto creation of action diagram & panel/report design ± Modular design » Panels & Reports ± Automatic design of panel & report layouts ± Interactive painting facilities ± Panel design prototyping facilities TATA CONSULTANCY SERVICES COOL:2E Training 13 .

Introduction to COOL:2E COOL:2E Features (contd«) » HLL code generation ± DDS or SQL for database ± DDS for panels & reports ± RPG/COBOL for AS/400 stand alone programs ± RPG/COBOL for server and COBOL/2 for client ± Automatic help text generation TATA CONSULTANCY SERVICES COOL:2E Training 14 .

journalling & error handling ± Automatic referential integrity & domain checks TATA CONSULTANCY SERVICES COOL:2E Training 15 .Introduction to COOL:2E COOL:2E Features (contd«) » Other features ± Automatic implementation of object naming standards ± Automatic implementation of panel design standards ± Automated documentation of generated systems ± Cross reference facilities ± Integration of user source code in generated functions ± Regeneration of source code after changes in design ± Facilities for commitment control.

Getting Started COOL:2E Product Libraries Contain the files and objects needed to use COOL:2E products » » » » » » » » Y1SY Y1SYVENG Y2SY Y2SYVENG Y2SYMDL Y2SYCBL Y2SYRPG Y2SYSRC COOL:2E/1E Products COOL:2E/1E National Language Library COOL:2E Base products COOL:2E National Language Library COOL:2E null model COOL:2E COBOL generators COOL:2E RPG generators COOL:2E source COOL:2E Training 16 TATA CONSULTANCY SERVICES .

Getting Started Development Environment 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. TATA CONSULTANCY SERVICES COOL:2E Training 17 .

journals.Getting Started Development Libraries  Model Library » Library in which the model resides  Generation Library » Associated with each model library » Contains source files. access paths (created using DDS) and journals  SQL Collection » Exists only if SQL is used for data definition » Contains files. data dictionaries & SQL access paths TATA CONSULTANCY SERVICES COOL:2E Training 18 . help text. compiled programs.

Getting Started Creating/Using a Model YCRTMDLLIB command creates a model YCRTMDLLIB Command Parameters » Model Library Name (MDLLIB) » Generation Library Name (GENLIB) » Design Standard (DSNSTD) like *CUATEXT etc. » File generation method : DDS/SQL » SQL Collection Library (SQLLIB) » Naming Prefixes ± Object Prefix (OBJPFX) ± Message Prefix (MSGPFX) TATA CONSULTANCY SERVICES COOL:2E Training 19 .

Getting Started Creating/Using a Model (contd«) YCRTMDLLIB Command Parameters (contd«) » Message File Name (MSGVNM) » Default HLL (HLLGEN) » HLL Naming Convention (HLLVNM) Build Library List using YBLDLIBLST » Change job¶s library list to contain COOL:2E Development Libraries and Product Libraries » Run command YBLDLIBLST <LIBL-Name> TATA CONSULTANCY SERVICES COOL:2E Training 20 .

Getting Started Creating/Using a Model (contd«) 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) TATA CONSULTANCY SERVICES COOL:2E Training 21 .

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

Data Modeling What is a Data Model? ‡ 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 TATA CONSULTANCY SERVICES COOL:2E Training 23 .

Data Modeling Entity-Relationship (E-R) Modeling ‡ Identify Primary Entities and their attributes ‡ Identify Relations between Entities and between Entities and the Attributes ‡ Normalize the Data Model TATA CONSULTANCY SERVICES COOL:2E Training 24 .

Data Modeling Entity-Relationship (E-R) Modeling Identifying Primary Entities » Review the data items from the analysis of business information » Select objects that are important to the business e.g. entities important to end users » Select objects about which information must be stored » Identify the business dimensions » Generalize or differentiate Entities TATA CONSULTANCY SERVICES COOL:2E Training 25 .

: Description Qty Price Total ________ ________ » ____________ ____________ ____ ____ ___ ____ ____ ___ The following primary entities can be identified a) Company b) Customer c) Order d) Product 26 COOL:2E Training TATA CONSULTANCY SERVICES . is shown below ABC Inc.example » Sales Order Entry form of ABC Inc.Data Modeling Entity-Relationship (E-R) Modeling Identifying Primary Entities . Customer Code: Name: Address: Date: Product Code Customer Copy Phone: Order No.

revealed that products are purchased from vendors for which purchase orders are generated.Data Modeling Entity-Relationship (E-R) Modeling Identifying Primary Entities . Therefore the following additional entities were identified a) Vendor b) Purchase Order Generalize Entities » Combine two entities representing different types of the same thing into one entity Differentiate Entities » Differentiate different types of the same thing as two different entities TATA CONSULTANCY SERVICES COOL:2E Training 27 .example » Further study of business of ABC Inc.

Customer has the following attributes Customer Code Customer Name Customer Address » Identify Domains which are the possible values of the identified attributes TATA CONSULTANCY SERVICES COOL:2E Training 28 .Data Modeling Entity-Relationship (E-R) Modeling Identifying Entity Attributes » Identify informational details of an entity » Each informational detail of an entity can form the attribute of the entity » Example .

Data Modeling Entity-Relationship (E-R) Modeling Identifying Relations » Identify relations between Entity and its attributes and between different Entities » Categorize relationship types by ± Optional/Mandatory ± Cardinality ± Involution » Select Primary Key or Unique Identifier for an Entity TATA CONSULTANCY SERVICES COOL:2E Training 29 .

Is the relationship Mandatory or Optional? » Cardinality .Does the connection exist between two different entities or from the same entity to itself? e. relation between employee and a manager when manager himself is an employee. one-tomany or many-to-many? Number of entity instances for a relationship » Involution . TATA CONSULTANCY SERVICES COOL:2E Training 30 .g.Data Modeling Entity-Relationship (E-R) Modeling Identifying Relations » Optional/Mandatory .Is the connection one-to-one.

One instance of an entity is related to multiple instances of another entity places e.each instance of one entity is related to one instance of another entity assigned to e.Data Modeling Entity-Relationship (E-R) Modeling Identifying Relations » One-To-One Relation .g.g. Salesperson has Territory » One-To-Many Relation . Customer placed by TATA CONSULTANCY SERVICES COOL:2E Training 31 Order .

Order ordered by Product TATA CONSULTANCY SERVICES COOL:2E Training 32 .g.each instance of one entity is related to more than one instance of another entity and vice versa orders e.Data Modeling Entity-Relationship (E-R) Modeling Identifying Relations » Many-To-Many Relation .

Customer K Customer Code Customer Name Customer Address Primary Key can be a single attribute.g.Data Modeling Entity-Relationship (E-R) Modeling Identifying Relations » Select 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. a relationship or a combination of attributes and relationships TATA CONSULTANCY SERVICES COOL:2E Training 33 .

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 TATA CONSULTANCY SERVICES COOL:2E Training 34 .Data Modeling Entity-Relationship (E-R) Modeling Identifying Relations » Implement Entity to Entity Relationship using Foreign Key Foreign Key .

Data Modeling Entity-Relationship (E-R) Modeling Identifying Relations .Foreign Key example: One-To-One relation assigned to Salesperson has Territory K Person ID Territory Name K Person ID Person Name example: One-To-Many relation has Company Part of Division K Company Code Division Code Division Name COOL:2E Training 35 K Company Code Company Name TATA CONSULTANCY SERVICES .

Foreign Key example: Many-To-Many relation worked on by Project works on worked on by Employee has Project works on Project Team Employee part of Project Employee K Project Code K Employee Code Project Name Employee Name Project Team K Project Code K Employee Code TATA CONSULTANCY SERVICES COOL:2E Training 36 .Data Modeling Entity-Relationship (E-R) Modeling Identifying Relations .

there is only one value of non-key attribute Full Functional Dependent Attribute » non-key attributes are dependent on all the key attributes of a composite key TATA CONSULTANCY SERVICES COOL:2E Training 37 .Data Modeling Normalizing the Data Model Normalization Involves » regrouping attributes » splitting entities » reassigning primary keys Functionally Dependent Attribute » for each value of the key.

Order splits into Order Header & Order Detail » Creating Second Normal Form (2NF) ± entity is 1NF ± every non-key attribute is fully functionally dependent on primary key » Creating Third Normal Form (3NF) ± entity is 2NF ± each non-key attribute is not dependent on another non-key attribute TATA CONSULTANCY SERVICES COOL:2E Training 38 .g.Data Modeling Normalizing the Data Model Process of Normalization » Creating First Normal Form (1NF) ± eliminate repeating data groups ± e.

g.g. owned by TATA CONSULTANCY SERVICES COOL:2E Training 39 .g.Data Modeling COOL:2E Data Model COOL:2E Objects (design elements) » File ± represents an entity e. Order » Field ± describes an item of data e. refers to. Order Number » Condition ± describes the values or set of values (domains) » Relation ± describes connection between two files or between file and field e.

Data Modeling COOL:2E Data Model Conceptual Model COOL:2E Data (E-R Model) Model --------------------------------------------------------------Entity Attribute Relationship Domain File Field Relation Field Conditions: Reference field types TATA CONSULTANCY SERVICES COOL:2E Training 40 .

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

TATA CONSULTANCY SERVICES

COOL:2E Training

41

Data Modeling
COOL:2E Data Model
*DSNR GXMMDL EDIT DATABASE RELATIONS => ___ _________________________ ? Typ Object __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ __ _________________________ Op: SYNGXM GXMMDL Rel lvl: ___ Relation ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ ____________ QPADEV0004 21/08/97 17:46:35 ___ ___ _______________________ Seq Typ Referenced object ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________ ___ _______________________

+ 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

TATA CONSULTANCY SERVICES

COOL:2E Training

42

Data Modeling
COOL:2E Data Model
COOL:2E Files
» Each COOL:2E File has a Name and a File Type » COOL:2E File Naming rules
± must be valid COOL:2E Name ± unique within the model ± up to 25 characters including embedded blanks ± e.g. Purchase Order is a valid COOL:2E file Name

» COOL:2E File Types
File Database Nondatabase Attribute CPT REF STR Description Capture file Reference file Structure file Example Order Entry Company file Audit date & time stamp
43

TATA CONSULTANCY SERVICES

COOL:2E Training

Ledger Entry » Structure (STR) files ± contain group of fields which can be included in other files using Includes relation ± e. Customer.g. Audit Stamp file TATA CONSULTANCY SERVICES COOL:2E Training 44 .Data Modeling COOL:2E Data Model COOL:2E Files » Reference (REF) files ± master files that typically contain non-volatile information ± e.g. Product. Order. Area Code » Capture (CPT) files ± contain transactional data that is recorded regularly ± e.g.

Change Object SELRCD .Data Modeling COOL:2E Data Model COOL:2E Files » Default functions ± standard functions are automatically defined for files ± default functions depend on file types » Default functions for REF files Function CRTOBJ .Select Record EDTFIL .Create Object DLTOBJ .Edit File TATA CONSULTANCY SERVICES COOL:2E Training Access Path UPD UPD UPD RTV RTV 45 .Delete Object CHGOBJ .

Delete Object CHGOBJ .Change Object Access Path UPD UPD UPD TATA CONSULTANCY SERVICES COOL:2E Training 46 .Data Modeling COOL:2E Data Model COOL:2E Files » Default functions for CPT files Function CRTOBJ .Create Object DLTOBJ .

Data Modeling
COOL:2E Data Model
COOL:2E Files
» Creating/Defining
± At the Edit Database Relations panel, press F10 to show Define Objects panel ± In the Object type column, enter FIL ± Type File Name in Object Name column ± Type CPT or REF or STR in Object attr column depending on the file type ± Defined as relation for the file is automatically created

TATA CONSULTANCY SERVICES

COOL:2E Training

47

Data Modeling
COOL:2E Data Model
DEFINE OBJECTS Object type ___ ___ ___ ___ ___ ___ ___ ___ Object name ________________________ ________________________ ________________________ ________________________ ________________________ ________________________ ________________________ ________________________ Op: SYNGXM GXMMDL Object attr ___ ___ ___ ___ ___ ___ ___ ___ QPADEV0004 22/08/97 15:31:12 Referenced field ________________________ ________________________ ________________________ ________________________ ________________________ ________________________ ________________________ ________________________ Field Edit usage field ___ _ ___ _ ___ _ ___ _ ___ _ ___ _ ___ _ ___ _

+

F3=Exit

TATA CONSULTANCY SERVICES

COOL:2E Training

48

Data Modeling
COOL:2E Data Model
COOL:2E Fields
» Each COOL:2E Field has a Name and a Field Type » COOL:2E Field Naming rules
± unique within the model ± up to 25 characters including embedded blanks ± e.g. Customer Code is a valid COOL:2E Field Name ± implementation name is different

» COOL:2E Field Types
± depends on the type of values ± broadly classified as alphanumeric, numeric & special field types
TATA CONSULTANCY SERVICES COOL:2E Training 49

0 5.Data Modeling COOL:2E Data Model COOL:2E Fields » COOL:2E Field Types (contd«) Field Type Name CDE DTE IGC NAR NBR PCT PRC QTY REF SGT STS TME TXT VAL VNM Description Code Date Idegraphic text Narrative text Number Percentage Price or tariff Quantity Reference Surrogate Status Time Descriptive name Monetary value Valid system name Type A P A A P P P P P A P A P A Length 6 7.0 1 6.2 5.0 7.0 20 30 5.2 10 Example Stock Code Date of birth Kanji name Comments # of employees Profit margin Unit Price Stock quantity Field based on another System Key Yes/No Change Time Product name Stock value File name 50 TATA CONSULTANCY SERVICES COOL:2E Training .0 25 11.2 7.

validation through a check condition TATA CONSULTANCY SERVICES COOL:2E Training 51 .Data Modeling COOL:2E Data Model COOL:2E Fields » Field Attribute Values ± Basic attributes: length. implementation name ± Text: Left Hand Side (LHS) text. valid name checking. Right Hand Side (RHS) Text. Modulus checking. Column Headings ± Validation attributes: upper/lower case checking.

Data Modeling COOL:2E Data Model COOL:2E Fields » Field Usage ± Two types: Database fields and Function fields » Database fields ± Code (CDE) fields:.g.used for key fields e. Company Name » Function fields ± fields used only in functions but do not reside in database TATA CONSULTANCY SERVICES COOL:2E Training 52 . Company Code ± Data attribute (ATR) fields: used for non-key fields e.g.

Data Modeling COOL:2E Data Model COOL:2E Fields » Function fields (contd«) ± fields used only in functions but do not reside in database ± fields can be added to data dictionary and accessed in device designs and action diagrams ± 6 function field usage types CNT (count) DRV (derived) MAX (maximum) MIN (minimum) SUM (sum) USR (user-defined) TATA CONSULTANCY SERVICES COOL:2E Training 53 .

Data Modeling COOL:2E Data Model COOL:2E Fields » Default Condition ± supplies the default value for a field ± *NONE: no default condition ± condition name: COOL:2E condition supplies default value ± *DTAARA: Default field value is retrieved from data area specified for the Dataarea field » Defining Field as a Data Area ± specify *DTAARA as default condition TATA CONSULTANCY SERVICES COOL:2E Training 54 .

enter FLD ± Type Field Name in Object Name column ± Type COOL:2E field type in the Object attr column ± Type Referenced field if the field refers to another field for domain ± In the Field Usage column. type CDE (Code) or ATR (attribute) or a function field usage TATA CONSULTANCY SERVICES COOL:2E Training 55 .Data Modeling COOL:2E Data Model COOL:2E Fields » Creating/Defining ± In the Object type column of Define Objects panel.

Data Modeling COOL:2E Data Model DEFINE OBJECTS Object type FIL FIL FLD FLD FLD FLD FLD FLD FLD Object name Dealer Dealer Dealer Dealer Dealer Dealer Dealer Dealer Dealer Op: SYNGXM GXMMDL QPADEV0004 22/08/97 15:31:12 Object Referenced attr field group Code name Address 1 Address 2 Group Code Group Name Group Credit Limit Field Edit usage field CDE ATR ATR ATR CDE ATR ATR + F3=Exit TATA CONSULTANCY SERVICES COOL:2E Training 56 .

Data Modeling COOL:2E Data Model COOL:2E Condition » Specifies the values or set of values a field may take » Condition has a Name. a type and an associated value » Condition Types ± VAL (Value) and LST (Value List) are valid condition types for status fields ± CMP (Compare) and RNG (Range) are valid condition types for non-status fields TATA CONSULTANCY SERVICES COOL:2E Training 57 .

Data Modeling COOL:2E Data Model COOL:2E Condition » Value (VAL) Condition ± used to specify single values that status field can take ± two related values: internal value .value in the implemented database external value . C and the condition Invoice not due has file value ³U´ TATA CONSULTANCY SERVICES COOL:2E Training 58 .g. Invoice Flag can have valid values U.value displayed/entered on the screen ± e.g. H. P. Premium paid condition has file value ³Y´ » List (LST) Condition ± used to specify list of values that status field can take ± screen functions implement prompt key (F4) ± e. D.

Stock Quantity field can have an associated condition by name between 10 and 100 with From value as 10 and To value as 100 TATA CONSULTANCY SERVICES COOL:2E Training 59 .Data Modeling COOL:2E Data Model COOL:2E Condition » Compare (CMP) Condition ± defined in terms of a fixed value and an operator ± valid operators: *EQ.g.g. *NE. Order Quantity field can have an associated condition by name greater than 10 with operator *GT and value 10 » Range (RNG) Condition ± defines range of values that field can take ± defined in terms of From and To values ± e. *LE ± e. *GT. *GE. *LT.

Known by.define the keys in files Attribute relations .declare non-key fields in files » Database relations can be entered using Edit Database Relations panel TATA CONSULTANCY SERVICES COOL:2E Training 60 .Data Modeling COOL:2E Data Model COOL:2E Relation » Expresses association between two files or between a file and a field » Eight relation types Defined as.declare files to exist Key relations . Has. Extended by. Includes. Owned by. Qualified by and Refers to » 3 different relation usage groups Definition relations .

Data Modeling COOL:2E Data Model COOL:2E Relation Usage Type Definition Key Relation Defined as Owned by Known by Qualified by Refers to Includes Has Extended by Used for File-to-file relationship File-to-file relationship File-to-field relationship File-to-field relationship File-to-file relationship File-to-field relationship File-to-field relationship File-to-file relationship Attribute Other TATA CONSULTANCY SERVICES COOL:2E Training 61 .

Data Modeling COOL:2E Data Model COOL:2E Relation » Defined as Relation ± File-to-file relation ± declares that a file exists ± e.g. Product Defined as Product ± Defined as relation is automatically created for a file if a reference is made to a non-existing file TATA CONSULTANCY SERVICES COOL:2E Training 62 .

Order Detail Owned by Order TATA CONSULTANCY SERVICES COOL:2E Training 63 .g.Data Modeling COOL:2E Data Model COOL:2E Relation » Owned by Relation ± File-to-file relation ± denotes a parent-child relationship ± primary key(s) of owning file become part of primary key of the owned by file ± keys of owning file are incorporated as high order keys in the owned file ± e.

time. sequence number etc TATA CONSULTANCY SERVICES COOL:2E Training 64 .Data Modeling COOL:2E Data Model COOL:2E Relation » Known by Relation ± File-to-field relation ± specifies the key field(s) for a file ± e.g. FIL Order Known by FLD Order Number FIL Order Has FLD Quantity » Qualified by Relation ± File-to-field relation ± to qualify a file identifier by one or more variable factors like date.

g. Product Price Owned by Product Code Product Price Qualified by Effective date Product Price Has Product price TATA CONSULTANCY SERVICES COOL:2E Training 65 .Data Modeling COOL:2E Data Model COOL:2E Relation » Qualified by Relation ± used for entities which represent continuum of values like currency rates having effective date ± appropriate fields of referring file can be redirected (RDR) to the effective field in referred file with a possibility of specifying *PREVIOUS or *NEXT ± field in the relation must be ATR and not CDE ± e.

g. Order Detail Refers to Product TATA CONSULTANCY SERVICES COOL:2E Training 66 .Data Modeling COOL:2E Data Model COOL:2E Relation » Refers to Relation ± File-to-file relation ± specifies that a file refers to another file ± Allows access to any of the fields on the referred to file from a referring file ± Primary key of the referred file becomes foreign key in the referring file ± Virtual field is created in the referring file and cannot be updated from the referring file ± e.

g. FIL Order Has FLD Quantity TATA CONSULTANCY SERVICES COOL:2E Training 67 . Product Includes Audit Stamp » Has Relation ± File-to-field relation ± declares a field to be present in a file as an attribute ± e.Data Modeling COOL:2E Data Model COOL:2E Relation » Includes Relation ± File-to-file relation ± file includes all the fields of a structure (STR) file ± e.g.

Customer Extended by Customer Detail TATA CONSULTANCY SERVICES COOL:2E Training 68 .g.Data Modeling COOL:2E Data Model COOL:2E Relation » Extended by Relation ± File-to-file relation ± declares a file to be extension of another file ± If used with Owned by relation. the fields of the extended file are available as Virtual Fields in the file being extended ± It is recommended to use Extended by relation along with Owned by relation ± e.

For Text clause can be used for further clarification ± e. Order Refers to Customer For: Ordering Sharing: *ALL Order Refers to Customer For: Invoicing Sharing: *ALL TATA CONSULTANCY SERVICES COOL:2E Training 69 .g.Data Modeling COOL:2E Data Model COOL:2E Relation » For Text ± For Text clause can be added to a relation to further clarify the description of a relationship ± If a file refers to another file more than once.

enter the file name ± Type the relationship in Relation column ± Type the referenced object (File or Field) in the Referenced Object column » Edit File Entries ± Type E in front of any relation to display Edit File Entries panel TATA CONSULTANCY SERVICES COOL:2E Training 70 .Data Modeling COOL:2E Data Model COOL:2E Relation » Creating/Defining ± At the Object column of Edit Database Relations panel.

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

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

Data Modeling COOL:2E Data Model COOL:2E Relation » Edit Field Details ± Type E2 in front of the File-field relation to display Edit Field Details panel for the field OR ± Type Z in front of the field entry in the Edit File Details panel TATA CONSULTANCY SERVICES COOL:2E Training 73 .

. : 1 Data type : A lowercase: GEN name .¶ µ) Translate cnd vlues F9=Conditions Validation . . . . . . . Right hand side. . Valid System name. . . Check condition. . . . . Column headings. . . : Blank (Y. . . . ) (Y. . .¶ µ) F8=Change name/type F20=Narrative TATA CONSULTANCY SERVICES COOL:2E Training 74 . . .Data Modeling COOL:2E Data Model EDIT FIELD DETAILS Op: SYNGXM GXMMDL QPADEV0004 22/08/97 16:11:55 Field name . : Type . . . . Text . . . . F3=Exit no update . . . . Default condition. . : ATR Internal length. . : STS REF: Payment Status Field usage . Mandatory fill . : Booking payment status Document¶n seq . : BKST K¶bd shift : Headings . . . . . . : : : : : : : : : : : : Booking payment status Booking payment status Value Booking payment status *NONE *NONE (Y. . Left hand side .

CMP. type the appropriate condition details like value. TATA CONSULTANCY SERVICES COOL:2E Training 75 . range etc. LST.Data Modeling COOL:2E Data Model COOL:2E Relation » Edit Field Condition ± Field condition can be added/modified using the Edit Field Condition and Edit Field Condition Detail panels ± Press F9 on the Edit Field Details panel to display Edit Field Condition panel ± In the Edit Field Condition panel. type condition name and condition type (VAL. or RNG) and press Enter to display Edit Field Condition Details panel ± In the Edit Field Condition Details panel.

. : VAL File value A Display value A1 Attr: STS Mode: *ADD Status value F3=Exit F8=Change name F20=Narrative TATA CONSULTANCY SERVICES COOL:2E Training 76 . . . . . . . : 1 on display. . .Data Modeling COOL:2E Data Model EDIT FIELD CONDITION DETAILS Op: SYNGXM GXMMDL QPADEV0004 22/08/97 16:11:55 Field name . . . : 4 Condition. . . . : Credit status Length of file . . : Blue chip Type . . . . .

Building Access Paths Introduction » COOL:2E creates default access paths (PHY. RTV & UPD) when a file is defined » Additional access paths may be created » COOL:2E access paths are implemented as one or more objects » Access path defines a physical file or the logical view of that file » Access path can be used to define order. column selection & record selection TATA CONSULTANCY SERVICES COOL:2E Training 77 .

Building Access Paths Introduction Six types of Access Paths » Physical (PHY) » Update (UPD) » Retrieval (RTV) » Resequence (RSQ) » Query (QRY) » Span (SPN) TATA CONSULTANCY SERVICES COOL:2E Training 78 .

Building Access Paths Physical (PHY) Access Path ‡ Single format file containing fields derived from resolution of all relations on the file. » Not keyed » No virtual fields » Created automatically for every REF/CPT file » Not referenced directly by functions » No additional PHY access paths allowed for a file » Created if a PF is retrieved through assimilation TATA CONSULTANCY SERVICES COOL:2E Training 79 .

single format access path which is used by functions for updation » Keyed on the fields that identify the file » No Virtual fields » Created automatically for every REF/CPT file » Additional UPD access paths may be created with the same key but subset of fields TATA CONSULTANCY SERVICES COOL:2E Training 80 .Building Access Paths Update (UPD) Access Path ‡ Uniquely keyed.

Building Access Paths Retrieval (RTV) Access Path ‡ Uniquely keyed. but all should have same key fields TATA CONSULTANCY SERVICES COOL:2E Training 81 . single format access path used by functions to retrieve records » Keyed exactly as the UPD access path » Allows virtual fields » Created automatically for every REF/CPT file » Associated with the UPD access path » Non-key fields can be dropped » Can select/omit records » Possible to define multiple RTV access paths for a given file.

Building Access Paths
Resequence (RSQ) Access Path
‡ Uniquely or non-uniquely keyed single format access path used by functions to retrieve records
» Must be created explicitly » Defaults to the keys of the based on file » Allows default keys to be changed which need not be unique » Allows virtual fields » Associated with RTV, which points to a UPD » Many RSQ access paths possible for single file
TATA CONSULTANCY SERVICES COOL:2E Training 82

Building Access Paths
Query (QRY) Access Path
‡ Keyed single format access path used by functions to retrieve records
» Must be created explicitly » Allows virtual fields on key & non-key fields » Available only for Print Object/Print File functions » Defaults to the keys of the based on file » Allows default keys to be changed » Associated with RTV, which points to a UPD » Many QRY access paths possible for single file » Implemented by OPNQRYF or Dynamic SQL
TATA CONSULTANCY SERVICES COOL:2E Training 83

Building Access Paths
Span (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 explicitly » Defaults to keys of based on files » These keys can be changed » Allows virtual fields » Associated with RTV, which points to a UPD » Many SPN access paths possible for single file
TATA CONSULTANCY SERVICES COOL:2E Training 84

Building Access Paths Access Path Summary # 1. 6. 4. Access Path Type PHY UPD RTV RSQ QRY SPN Real Fields       Key Fields x Relation Relation User User User COOL:2E Training Virtual Fields x x     Virtual Keys x x x x  x 85 TATA CONSULTANCY SERVICES . 5. 3. 2.

S(n)-Select. E(n)-Entries.fields. N(n)-Narr. F17=Services 86 . V-Virt.Building Access Paths Adding an Access Path *DSNR SYNGXMMDL Op: SYNGXM SYNGXMMDL Rel lvl: Relation Seq Known by Has Has Has Has Has Has Known by Has Has Known by Refers to Has Has Owned by QPADEV0007 11/02/98 12:02:11 EDIT DATABASE RELATIONS => ? Typ Object FIL Customer FIL Customer FIL Customer FIL Customer FIL Customer FIL Customer FIL Customer FIL Inventory FIL Inventory FIL Inventory FIL Sales Order Header FIL Sales Order Header FIL Sales Order Header FIL Sales Order Header FIL Sales Order Lines Typ FLD FLD FLD FLD FLD FLD FLD FLD FLD FLD FLD FIL FLD FLD FIL Referenced object Customer Code Customer Name Customer Address 1 Customer Address 2 Customer Address 3 Customer Credit Limit Customer Limit Used Item Code Item Name Item Quantity Sales Order Number Customer Sales Order Date Shipment Date Sales Order Header + SEL: Z(n)-Details. F-Funcs TATA CONSULTANCY SERVICES F3=Exit F5=Reload F7=Fields F9=Insert COOL:2E Training F10=Define obj.

Building Access Paths Adding an Access Path » Type Z against any relation on the Edit Database Relations panel for the file and press Enter » On the resulting Edit File Details panel. enter Access Path name and type and press Enter » Type Z to zoom into the new access path and specify details on the Edit Access Path Details panel » Type Z on the Edit Access Path Details panel to go to Edit Access Path Format Entries panel TATA CONSULTANCY SERVICES COOL:2E Training 87 .

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

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

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

Building Access Paths Adding an Access Path Span (SPN) Access Path » A SPN access path can only be specified over files with Owned by or Refers to relationships » A SPN access path must be created over an owning or referred to file » Press F9 on Edit Access Path Details panel to first select the primary format and then the secondary format TATA CONSULTANCY SERVICES COOL:2E Training 91 .

Rebld.Building Access Paths Modifying an Access Path Following may be changed from Edit Access Path Details panel » Unique/Duplicate key sequence » Access Path Maintenance (Immed. Dly) » Alternate Collating Sequence » Select/Omit Criteria » Generation Mode (DDS/SQL) » Source member name & text TATA CONSULTANCY SERVICES COOL:2E Training 92 .

signs are ignored TATA CONSULTANCY SERVICES COOL:2E Training 93 .Building Access Paths Arrays » Arrays have a defined layout with each element having the same layout » Must have a defined key that acts as an index » Key is any subset of the fields with a maximum composite key length of 990 » Sequence of equally keyed elements in a non-unique array is not guaranteed » Each key in the composite key acts as a different array dimension » Key can be ascending/descending » For key sequence.

to add an element » CHGOBJ .to delete an element » RTVOBJ .to change an element » DLTOBJ .to read an element or set of elements TATA CONSULTANCY SERVICES COOL:2E Training 94 .Building Access Paths Arrays Arrays can be used by the following four functions: » CRTOBJ .

Building Access Paths Arrays Features » Can be used to define a set of fields to be used as a parameter entry to a function » Arrays are initialized on the first program call » Subsequent calls will not clear the array TATA CONSULTANCY SERVICES COOL:2E Training 95 .

Building Access Paths Arrays Adding/Changing/Deleting Arrays » Enter *a in the option field or *ARRAYS in the positioner field of Edit Database Relations panel » Enter Z against *Arrays file in the resulting panel to see a list of arrays » Type an array name and press Enter » Type Z against the array name and press Enter to define fields » Type D against an existing array and press Enter to delete TATA CONSULTANCY SERVICES COOL:2E Training 96 .

Building Access Paths Generating & Compiling » Generate source members and compile the generated source to produce objects. files & tables » From Edit Database Relations panel. press F17 for services » On Display Services Menu. type 8 at bottom of screen to display Display All Access Paths panel » Type J (batch generation) or G (interactive generation) and press Enter TATA CONSULTANCY SERVICES COOL:2E Training 97 .

Building Applications COOL:2E Functions COOL:2E function is a process that operates on files & fields COOL:2E Functions can be linked to create larger processes that become the building blocks of an application Several COOL:2E functions may be implemented in a single HLL program TATA CONSULTANCY SERVICES COOL:2E Training 98 .

Building Applications Implementation of Functions COOL:2E functions are implemented in two ways » External .the function is implemented as source code inside the calling function TATA CONSULTANCY SERVICES COOL:2E Training 99 .the function is implemented as a separate HLL program » Internal .

Building Applications COOL:2E Function Types 4 COOL:2E functions types » Standard Functions » Built-In Functions » Functions Fields » Message Functions Standard functions » specify the entire programs or subroutines » User-defined processing can be specified » Provide building blocks of an application TATA CONSULTANCY SERVICES COOL:2E Training 100 .

string manipulation. control operations like commitment control & program exit TATA CONSULTANCY SERVICES COOL:2E Training 101 .Building Applications COOL:2E Function Types Standard Functions » Divided into 3 categories ± Database Functions ± Device Functions ± User Functions Built-in Functions » Execute functions like arithmetic operations.

Divide 7) DIV WITH REMAINDER 8) Exit Program 9) Modulo TATA CONSULTANCY SERVICES COOL:2E Training 102 .Building Applications COOL:2E Function Types Built-in Functions » Specified within action diagrams » Implemented as in-line source code within calling functions » The Built-in functions are 1) Add 2) Commit 3) Compute 4) CONCAT -Concatenation 5) CVTVAR .Convert Variable 6) DIV .

Retrieve Condition 15) Rollback 16) Set Cursor 17) Substring 18) SUB .Subtract TATA CONSULTANCY SERVICES COOL:2E Training 103 .Multiply 13) Quit 14) RTVCND .Building Applications COOL:2E Function Types Built-in Functions » The Built-in functions are (contd«) 10) Move 11) Move All 12) MULT .

Derived 6) USR .Sum 2) MAX .Count 5) DRV .Maximum 3) MIN .Minimum 4) CNT .Building Applications COOL:2E Function Types Function Fields » A field whose value is not physically stored in the database » Derived from other fields or files » One result parameter .User TATA CONSULTANCY SERVICES COOL:2E Training 104 .the derived field » Variable number of input parameters used to derive the value » COOL:2E provides ready-made function fields 1) SUM .

Building Applications COOL:2E Function Types Message Functions » Define workstation messages » Implemented using OS/400 message descriptions » Sent by a call to a CL subroutine » Can make direct references to fields in the data model TATA CONSULTANCY SERVICES COOL:2E Training 105 .

Building Applications COOL:2E Function Types Message Functions » The Message functions are 1) SNDERRMSG .Send Information Message 3) SNDCMPMSG .Execute Message TATA CONSULTANCY SERVICES COOL:2E Training 106 .Retrieve Message 6) EXCMSG .Send Complete Message 4) SNDSTSMSG .Send Status Message 5) RTVMSG .Send Error Message 2) SNDINFMSG .

Retrieve Object TATA CONSULTANCY SERVICES COOL:2E Training 107 .Building Applications Standard Functions Database Functions » Basic routines for accessing the database » Implemented as part of an external function » Can be used in many different functions » There are 4 database functions 1) CRTOBJ .Delete Object 4) RTVOBJ .Create Object 2) CHGOBJ .Change Object 3) DLTOBJ .

Building Applications Standard Functions Device Functions » Used in interactive & report programs » Consist of panel/report design & action diagram » All device functions are external functions except for PRTOBJ function » Implemented as programs that operate over databases TATA CONSULTANCY SERVICES COOL:2E Training 108 .

Edit Record 3 panels TATA CONSULTANCY SERVICES COOL:2E Training 109 .Edit Record 6) EDTRCD2 .Display Record 3 panels 4) PMTRCD .Display Record 2 panels 3) DSPRCD3 .Building Applications Standard Functions Device Functions (contd«) » The Device Functions are 1) DSPRCD .Display Record 2) DSPRCD2 .Edit Record 2 panels 7) EDTRCD3 .Prompt Record 5) EDTRCD .

Print Object TATA CONSULTANCY SERVICES COOL:2E Training 110 .Edit Transaction 13) PRTFIL .Building Applications Standard Functions Device Functions (contd«) » The Device Functions are 8) DSPFIL .Edit File 10) SELRCD .Display File 9) EDTFIL .Display Transaction 12) EDTTRN .Print File 14) PRTOBJ .Select Record 11) DSPTRN .

Building Applications Standard Functions User Functions » Means of incorporating user programs or subroutines into COOL:2E generated applications » Processing steps can be specified with action diagrams or user-written HLL » Implemented as inline code (internal functions) or call to programs (external functions) TATA CONSULTANCY SERVICES COOL:2E Training 111 .

Execute External Function 3) EXCUSRPGM .Building Applications Standard Functions User Functions » The User Functions are 1) EXCINTFUN .Execute User Source TATA CONSULTANCY SERVICES COOL:2E Training 112 .Execute User Program 4) EXCUSRSRC .Execute Internal Function 2) EXCEXTFUN .

Building Applications Basic Function Properties Function Name » up to 25 characters long including embedded blanks & must be unique within a file Function Components » Function options ± allow the user to customize function features like database changes. display features. exception routines. exit control. generation options & environment options TATA CONSULTANCY SERVICES COOL:2E Training 113 . commitment control.

Building Applications Basic Function Properties Function Components » Function Parameters ± specify the input and output parameters. This is a combination of default COOL:2E supplied and optional user defined processing logic TATA CONSULTANCY SERVICES COOL:2E Training 114 . Parameters are also used to define local variables for the function » Device Designs ± specify the visual presentation of the 2 types of devices used by functions: Panels & Reports » Action Diagrams ± specify the processing steps for function logic.

x3 x x x 1 EXCINTFUN & EXCEXTFUN have action diagrams 2 Only DRV (Derived) function fields have action diagrams 3 EXCEXTFUN is the only user function with function options TATA CONSULTANCY SERVICES COOL:2E Training 115 . x x Function Options  x . x x 2 .Building Applications Basic Function Properties Function Components Function class Device Functions Database Functions User Functions Messages Function Fields Built-In Functions Parameters       Device Design  x x x x x Action Diagrams  x 1 .

Building Applications Basic Function Properties Default Device Function Processing » Default Device functions compile into working programs with default processing » Additional logic required for business processing TATA CONSULTANCY SERVICES COOL:2E Training 116 .

Building Applications Functions & Access Paths Functions & Access paths » Functions operating on a file are always attached to it by an access path » Functions can access many files with access paths based on several files » A generated program can be made up of several functions each accessing a different access path » Default panel/report formats are derived from the function¶s access path TATA CONSULTANCY SERVICES COOL:2E Training 117 .

TATA CONSULTANCY SERVICES COOL:2E Training 118 .Building Applications Additional Processing Automatic additional logic for functions » Integrity Checking ± Domain integrity checking for allowed values. ± Referential Integrity Checking to ensure that relations specified in the model are satisfied » Field Validation ± upper/lower case validation ± valid name checking ± validation through a check condition. Enforced by fields having same reference file.

required functionality can be achieved TATA CONSULTANCY SERVICES COOL:2E Training 119 .Building Applications Additional Processing Automatic additional logic for functions » Linking Functions ± Automatically links certain functions together ± External update functions like EDTFIL are automatically linked to database function like CHGOBJ Building Blocks Approach » Functions are building blocks » By linking functions together.

messages etc. » Type * in the Object field & DFN in relations field of Edit Database Relations panel to access TATA CONSULTANCY SERVICES COOL:2E Training 120 .Building Applications Defining Functions Accessing Functions » Display All Functions panel ± select option from the Services Menu » Display 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.

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

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

E(n)-Entries. S(n)-Select. V-Virt. F-Funcs F3=Exit F5=Reload F7=Fields F9=Insert F10=Define obj. N(n)-Narr.fields.Building Applications Defining Functions *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. F17=Services TATA CONSULTANCY SERVICES COOL:2E Training 123 .

routine to add a record to a file. 2) CHGOBJ .Building Applications Database Functions What are Database functions? » means of performing actions on database » defined as HLL subroutine 4 Database functions 1) CRTOBJ .routine to delete a record. 3) DLTOBJ . TATA CONSULTANCY SERVICES COOL:2E Training 124 .routine to retrieve one or more records. 4) RTVOBJ .routine to update a record.

CHG and DLT database functions are created for all REF & CPT files.Building Applications Database Functions Default versions of CRT. TATA CONSULTANCY SERVICES COOL:2E Training 125 . RTVOBJ must be created if needed. Additional processing before and after database access may be specified in the action diagram.

RSQ TATA CONSULTANCY SERVICES COOL:2E Training 126 .Building Applications Database Functions Function CRTOBJ CHGOBJ DLTOBJ RTVOBJ Purpose Add a single record Update a single record Delete a single record Read a record or record(s) Access Path UPD UPD UPD RTV.

the 4 database functions can be defined over an array and used. » DLTOBJ with no parameter will clear an array TATA CONSULTANCY SERVICES COOL:2E Training 127 .Building Applications Database Functions Array Processing » Even though arrays are not implemented as database files.

Building Applications Device Functions What are Device Functions? » Interactive panels or reports » Panel device functions for interactive user interface between end user and application » Report device functions for written presentation of data » All device functions except PRTOBJ function are implemented as external functions TATA CONSULTANCY SERVICES COOL:2E Training 128 .

Building Applications Device Functions Interactive device design editor » Allows defining of ± field attributes ± positioning ± conditioning ± user function keys ± literals » Can be accessed from Edit Functions. or the Display All Functions panels TATA CONSULTANCY SERVICES COOL:2E Training 129 . Edit All Functions. Edit Function Devices.

Building Applications Device Functions Device Standard Header device functions » Define Screen Format (DFNSCRFMT) ± to define standard screen header and footer for use by other functions with attached screen design » Define Report Format (DFNRPTFMT) ± to define standard report header and footer for use by Print File report functions TATA CONSULTANCY SERVICES COOL:2E Training 130 .

a key panel prompts for a key TATA CONSULTANCY SERVICES COOL:2E Training 131 .Building Applications Device Functions Single record device functions » Prompt Record (PMTRCD) ± defines a program to prompt for a list of fields defined by a specified access path ± validated values can be passed to another function » Display Record (DSPRCD) ± defines a program to display a single record from a specified database file ± If no key is specified.

.Building Applications Device Functions Single record device functions (contd.) » Display Record 2 panels (DSPRCD2) ± identical to DSPRCD except that it allows the record details to extend into 2 device pages » Display Record 3 panels (DSPRCD3) ± identical to DSPRCD except that it allows the record details to extend into 3 device pages TATA CONSULTANCY SERVICES COOL:2E Training 132 ..

TATA CONSULTANCY SERVICES COOL:2E Training 133 .Building Applications Device Functions Single record device functions (contd«) » Edit Record (EDTRCD) ± defines a program to maintain (add. » Edit Record 2 panels (EDTRCD2) ± identical to EDTRCD except that it allows the record details to extend into 2 device pages. a key panel prompts for a key. ± If no key is specified. change or delete) records one at a time. » Edit Record 3 panels (EDTRCD3) ± identical to EDTRCD except that it allows the record details to extend into 3 device pages.

using a subfile ± the subfile is loaded one page at a time when the user presses ROLLUP/F8. TATA CONSULTANCY SERVICES COOL:2E Training 134 . using a subfile ± the subfile is loaded one page at a time when the user presses ROLLUP/F8 » Edit File (EDTFIL) ± defines a program to maintain the records in a file many at a time.Building Applications Device Functions Multiple record device functions » Display File (DSPFIL) ± defines a program to display the records in a file many at a time.

using a subfile ± allows the user to select one record which is returned to the calling program ± called from a function that requests a selection list.Building Applications Device Functions Multiple record device functions (contd«) » Select Record (SELRCD) ± defines a program to display the records in a file many at a time. TATA CONSULTANCY SERVICES COOL:2E Training 135 .

Building Applications Device Functions Single & multiple record device functions » Display Transaction (DSPTRN) ± defines a program to display the records from a selected pair of database files ± the pair must be connected by an Owned by or Refers to relation » Edit Transaction (EDTTRN) ± defines a program to maintain the records from a selected pair of database files ± the pair must be connected by an Owned by or Refers to relation. TATA CONSULTANCY SERVICES COOL:2E Training 136 .

TATA CONSULTANCY SERVICES COOL:2E Training 137 .Building Applications Device Functions Printer device functions » Print File (PRTFIL) ± defines a program to print records from a specified access path. » Print Object (PRTOBJ) ± defines a particular report fragment which will print the records from a specified access path at any point within a PRTFIL function ± can be embedded within other PRTOBJ functions.

Building Applications Device Functions Standard Features of Device Functions » Diagnostic messages ± message sent to program¶s message queue ± message subfile to show the pending messages ± allows second level text and substitution variables » Highlighting of Errors ± a field in error is highlighted in reverse image ± cursor is positioned at first such field » On-line Help Text TATA CONSULTANCY SERVICES ± pressing HELP key or F1 key results in call to a help program COOL:2E Training 138 .

Building Applications Device Functions Standard Features of Device Functions » Print Key ± print key is enabled to allow panel prints ± print file is controlled by YPKYVNM model value » Selection Columns ± Selection subfiles have selection column on the left » Function key Usage ± CUA standards are followed e. F3 is exit » Positioning facilities ± subfile programs have a positioning field TATA CONSULTANCY SERVICES COOL:2E Training 139 .g.

Building Applications Device Functions Standard Features of Device Functions » Single Page Subfile load up ± subfiles are loaded on demand basis ± only when F8 or ROLLUP keys are pressed » Concurrency checking and record locking ± updation programs do not hold locks upon database while changes are entered or validated ± includes logic at the point of update to check for record lock by other users » Overflow Handling ± report functions include handling of page overflow TATA CONSULTANCY SERVICES COOL:2E Training 140 .

Building Applications User Functions What are User Functions? » means of implementing additional user processing within an existing function or as an independent implementation along with an existing function » e.g. batch functions for updating database having no associated device or a user-written HLL program which has to be integrated to COOL:2E generated application TATA CONSULTANCY SERVICES COOL:2E Training 141 .

Building Applications User Functions Two types of User Functions » Free-Form User functions ± specify actions that can be used within a function or called from a function ± processing logic is defined through the Action Diagram editor » User Coded User functions ± functions are user-written in HLL ± can be called or embedded TATA CONSULTANCY SERVICES COOL:2E Training 142 .

Building Applications User Functions Free-Form User Functions » Execute Internal Function (EXCINTFUN) ± allows specification of a section of an action diagram for repeated use in other functions ± implemented as Internal function » Execute External Function (EXCEXTFUN) ± allows specification of an HLL program using an action diagram ± implemented as External function TATA CONSULTANCY SERVICES COOL:2E Training 143 .

Building Applications
User Functions
User Coded User Functions
» Execute User Program (EXCUSRPGM)
± describes interface to a user written HLL program ± parameters can be specified on the call

» Execute User Source (EXCUSRSRC)
± specifies that user-written HLL code be included within the HLL source generated by COOL:2E for an external function

TATA CONSULTANCY SERVICES

COOL:2E Training

144

Building Applications
Message Functions
What are Message Functions?
» means of defining messages of various types, specifying different message files for the message, specifying substitution variables and changing message identifiers » can be accessed by looking at functions of *MESSAGES file

TATA CONSULTANCY SERVICES

COOL:2E Training

145

Building Applications
Message Functions
6 Message Functions
» Send Error Message (SNDERRMSG)
± error message to be sent to a calling function ± used for diagnostic messages arising from user validation

» Send Information Message (SNDINFMSG)
± information message be sent to the message queue of the calling program

» Send Completion Message (SNDCMPMSG)
± completion message to be sent to a calling function
TATA CONSULTANCY SERVICES COOL:2E Training 146

Building Applications Message Functions 6 Message Functions » Send Status Message (SNDSTSMSG) ± status message to be sent to a calling function ± informs of the progress of a long-running process » Retrieve Message (RTVMSG) ± to retrieve message text from message in message file » Execute Message (EXCMSG) ± specifies that a request message has to be executed TATA CONSULTANCY SERVICES COOL:2E Training 147 .

Building Applications Function Fields What are Function Fields? » Special types of fields that can be used in device designs and action diagrams » based on other fields » processing can be specified for a function field TATA CONSULTANCY SERVICES COOL:2E Training 148 .

DSPTRN.Building Applications Function Fields Function field Usages » Sum (SUM) ± contains sum of values of another field ± Input Parameter is the field whose sum is to be calculated ± Result Parameter is the field containing the sum » Count (CNT) ± defines count of a set of records in EDTTRN. PRTFIL & PRTOBJ functions ± Input Parameter is field on the detail or subfile record ± Output field contains the count TATA CONSULTANCY SERVICES COOL:2E Training 149 .

Building Applications Function Fields Function field Usages » Maximum (MAX) ± contains the highest value of another field ± Input Parameter is the field whose maximum is to be calculated ± Result Parameter is the field containing the maximum » Minimum (MIN) ± contains the lowest value of another field ± Input Parameter is the field whose minimum is to be calculated ± Result Parameter is the field containing the minimum TATA CONSULTANCY SERVICES COOL:2E Training 150 .

menu options. command string ± can be input-capable or output only TATA CONSULTANCY SERVICES COOL:2E Training 151 .g.Building Applications Function Fields Function field Usages » Derive (DRV) ± performs user-defined action to derive result ± action diagram is attached where processing can be specified for deriving the result ± Multiple input Parameters can be specified ± One Resulting Parameter » User (USR) ± reserved for work fields needed in device design or action diagram e.

Building Applications Function Options What are Function Options? » Function options control the features of functions » Function Options for ± Database Changes ± Display Features ± Exit Control ± Commitment Control ± Exception Routine ± Generation ± Environment TATA CONSULTANCY SERVICES COOL:2E Training 152 .

change or delete capabilities or a combination Display Features Function options » Confirmation .function determines initial mode of execution TATA CONSULTANCY SERVICES COOL:2E Training 153 .Building Applications Function Options Database Changes Function options » determine if program allows add.function prompts for confirmation » Initial value for Confirmation » Standard Header/Footer selection » Subfile Selection Column » Dynamic Program Mode .

for EDTRCD functions » Repeat Prompt .whether message subfile at bottom of panel for first or all errors TATA CONSULTANCY SERVICES COOL:2E Training 154 .Building Applications Function Options Display Features Function options » Exit after Add .whether key screen to be displayed before displaying detail screen » Post Confirm Pass .to re-read database file and update subfile after confirmation » Send All Messages .whether prompt (PMTRCD) to be redisplayed after user processing » Bypass Key Screen .

Building Applications Function Options Exit Control » Determines execution characterstics of programs » Closedown Program .whether program will terminate or remain invoked but inactive » Reclaim Resources .whether RCLRSC command will be invoked after program call » CopyBack Messages .whether pending messages in program message que to be copied to program message queue of calling program TATA CONSULTANCY SERVICES COOL:2E Training 155 .

program contains commit points but the program does not ensure that commitment is active » NONE .program contains commit points and the program ensures that commitment is active » SLAVE . SLAVE or NONE » MASTER .Building Applications Function Options Commitment Control » Determines commitment control regime for a program namely MASTER.program does not run under commitment control TATA CONSULTANCY SERVICES COOL:2E Training 156 .

specifies whether code for exception routine (*PSSR) should be generated Generation Options » Generation Mode .Building Applications Function Options Exception Routine » Generate Exception Routine . M for model value A if generation value of primary path to be used TATA CONSULTANCY SERVICES COOL:2E Training 157 .specifies database access used for functions D for DDS access method. S for SQL access method E for External Source Format.

specifies whether help is generated » Screen Text Constants L results in panel literals being hardcoded in source M results in panel literals to be stored in message file D means model value to be used TATA CONSULTANCY SERVICES COOL:2E Training 158 .Building Applications Function Options Generation Options » Generate Help .

Output only. EXCMSG or any external function TATA CONSULTANCY SERVICES COOL:2E Training 159 . Both.Building Applications Function Parameters What are Function Parameters? » Specifies the fields passed between functions Basic properties of function parameters » Name » Usage Type ± Input only. Neither » Flag Error Status ± specifies error in the called function ± allowed in SNDERRMSG.

Building Applications Function Parameters Neither Parameters » No value passed or returned for a parameter » Neither parameters are available for use as local variables within the function Default parameters of functions Function CHGOBJ CRTOBJ DLTOBJ RTVOBJ SELRCD Default parameters All fields of Update index All fields of Update index Key fields of Update index Key fields of attached acc. path Key fields of Update index COOL:2E Training Usage I I I I B 160 TATA CONSULTANCY SERVICES .

Building Applications Function Parameters Return Code Parameter » Informs the calling program of the state under which called program was exited » All functions except EXCUSRPGM & EXCUSRSRC have implicit return code parameter as first parameter » The values of Return Code parameter are *DBF error. *Normal. *Record does not exist. *User Quit requested TATA CONSULTANCY SERVICES COOL:2E Training 161 . *Substring error. *Record already exists.

the parameter restricts the updation of field by making it input only field Positioner Parameter . Map Neither parameter adds field to panel design without passing a value Restrictor Parameter .the parameter is added automatically to the corresponding field on the receiving function¶s panel design.the parameter is used to position a function to start reading records from a particular record TATA CONSULTANCY SERVICES COOL:2E Training 162 .Building Applications Function Parameters Parameter Roles » Specifies the use of parameter in function » Following are the parameter roles Map Parameter .

Useful for interfacing with user-written functions Defining Function Parameters » in the Edit Functions panel.Building Applications Function Parameters Parameter Roles Vary Parameter . type P next to the selected function » specify a field or a set of fields in Edit Function Parameters panel » Type Z for a parameter to specify Role/Usage through Edit Function Parameter Details panel TATA CONSULTANCY SERVICES COOL:2E Training 163 .the parameter can have a varying length.

: 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 TATA CONSULTANCY SERVICES COOL:2E Training 164 .Building Applications Function Parameters Op: SYNTHS QPADEV0007 19/02/98 10:38:58 EDIT FUNCTION PARAMETERS SYNSXT Function name. .

D-Drop. M-Map. Role: R-Restrict. F3=Exit TATA CONSULTANCY SERVICES COOL:2E Training 165 . V-Vary length. B-Both. O-Output. P-Position. : 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. N-Neither. .Building Applications Function Parameters Op: SYNTHS QPADEV0007 19/02/98 10:40:20 EDIT FUNCTION PARAMETER DETAILS SYNSXT Function name.

Building Applications Device Designs What are Device Designs? » Specifies the layouts of fields and constants on the panels or report designs for a function Basic properties of Device Designs » Device Design Standard ± depends on the function type and associated standard header/footer functions » Device Design Format ± Formats are created from the fields of the based-on access path and their associated text TATA CONSULTANCY SERVICES COOL:2E Training 166 .

Building Applications Device Designs Basic properties of Device Designs » Device Design Field ± fields come from access path. type S next to the selected function to display the device design » use function keys to edit the device design ± F1 moves the field 40 columns ± F3 exits the panel TATA CONSULTANCY SERVICES COOL:2E Training 167 . function parameters and Header/Footer Editing Device Design » in the Edit Functions panel.

Building Applications Device Designs Editing Device Design » use function keys to edit the device design ± F4 move the field 40 columns to the right ± F5 edits device format details ± F6 cancels the pending operations ± F7 displays Edit Device Design Format Relations ± F8 moves the selected field to the cursor position ± F9 wraps text onto next line ± F10 moves text one column to the right ± F11 removes the line ± F12 aligns text below cursor position TATA CONSULTANCY SERVICES COOL:2E Training 168 .

Building Applications Device Designs Editing Device Design » use function keys to edit the device design ± F13 fast exits the panel ± F15 moves panel window to left margin ± F16 moves window to right margin ± F17 displays a list of device formats ± F18 displays the Edit Field Attributes panel ± F19 adds new function field to the device ± F20 edits function field on the device ± F21 adds a line above cursor ± F22 moves text one column to the left TATA CONSULTANCY SERVICES COOL:2E Training 169 .

Building Applications Device Designs Editing Device Design » use function keys to edit the device design ± F23 adds constant field to the device design ± F25 aligns all fields under the cursor position TATA CONSULTANCY SERVICES COOL:2E Training 170 .

Building Applications Action Diagrams What are Action Diagrams? » Action Diagrams record the basic constructs that make up a procedure » the procedural steps encompass a list of actions like call to another function or a low-level built-in function Displaying Action Diagram of a function » Type F next to the selected function in the Edit Functions panel TATA CONSULTANCY SERVICES COOL:2E Training 171 .

.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 TATA CONSULTANCY SERVICES COOL:2E Training 172 .*NO . | | Display screen .-.Initialize . | '-ENDWHILE . | | .=REPEAT WHILE .=REPEAT WHILE ..*Reload subfile is *NO . ...Building Applications Action Diagrams EDIT ACTION DIAGRAM FIND=> Edit SYNSXT Commodity Edit Commodity > Edit Commodity . .Process response .. '-ENDWHILE .. |-*ALWAYS . | PGM.*Reload subfile = CND.. . | |-PGM. | . | . | > Conduct screen conversation .Load first subfile page ..

Building Applications Action Diagrams User Points » COOL:2E/2 functions except EXCUSRSRC & EXCUSRPGM have default action diagram » some portions of default action diagrams which depict essential processing are not alterable » areas which can be modified and where business logic can be entered are called User Points » Press F5 on the action diagram to display user points for the function TATA CONSULTANCY SERVICES COOL:2E Training 173 .

|-*A : USER: Initialize subfile record (new record) : .....Process response .... .. | PG : USER: Validate subfile control : ........... | ..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 TATA CONSULTANCY SERVICES COOL:2E Training 174 .....Z-Select..: USER: Validate subfile record relations + : ...... : CALC: Subfile control function fields : .. | '-ENDWHILE ... | | ......... | > : USER: Validate subfile record fields : . : ........ | |.......I : USER: Initialize subfile header : ......-: USER: Initialize program : ............... | | :........... > Edit : ACTION DIAGRAM EXIT POINTS F3=Exit SEL:X.. '-ENDWHILE ..... . | .....Building Applications Action Diagrams EDIT ACTION DIAGRAM Edit SYNSXT Commodity FIND=> Edit Commodity ..........=RE : USER: Initialize subfile record (existing record) : ..... .........: ..= : CALC: Subfile record function fields : ...............

:___ TATA CONSULTANCY SERVICES COOL:2E Training 175 . : «.Building Applications Action Diagrams Action Diagram Constructs » Sequential .specify a list of actions or other constructs that are executed in a sequential order. Denoted by brackets enclosing dotted lines ___ : «.

actions are conditionally executed and are called CASE blocks. : «. Denoted by CASE and ENDCASE statements _ CASE : «.Building Applications Action Diagrams Action Diagram Constructs » Conditional . :_ ENDCASE TATA CONSULTANCY SERVICES COOL:2E Training 176 .

Denoted by REPEAT WHILE and ENDWHILE statements _ REPEAT WHILE : «.represents repetitive logic. : «. :_ ENDWHILE TATA CONSULTANCY SERVICES COOL:2E Training 177 .Building Applications Action Diagrams Action Diagram Constructs » Iterative .

instances of same database field available in more than one file » Device Contexts .instances of fields available from various system values COOL:2E Training TATA CONSULTANCY SERVICES 178 .instances of field available from literals like condition etc. » System Contexts .Building Applications Action Diagrams Context » instances of a field that are available for use at a particular processing step » Database Contexts .instances of same device field available in more than one format » Literal Contexts .

g.Building Applications Action Diagrams Context » Function Contexts .fields are from second format of the based on access path e.instances of field available from function attributes like parameter Database Contexts » DB1 . in SPN access path TATA CONSULTANCY SERVICES COOL:2E Training 179 .fields are in the first or the only format of the based-on access path » DB2 .

fields are from the third panel of EDTRCDn or DSPRCDn functions TATA CONSULTANCY SERVICES COOL:2E Training 180 .Building Applications Action Diagrams Device Contexts » KEY .fields are from the key panel display in case of EDTRCD or DSPRCD functions » DTL .fields are from the second panel of EDTRCDn or DSPRCDn functions » 3RD .fields are from the first panel of EDTRCDn or DSPRCDn functions » 2ND .

fields are from the next active report format in PRTOBJ and PRTFIL functions TATA CONSULTANCY SERVICES COOL:2E Training 181 .Building Applications Action Diagrams Device Contexts » CTL .fields are from the subfile control record format » RCD .fields are from the subfile record format » CUR .fields are from the current report format in PRTOBJ and PRTFIL functions » NXT .

g. *USER. *Return Code TATA CONSULTANCY SERVICES COOL:2E Training 182 .Building Applications Action Diagrams Literal Contexts » CND .contains system fields that control the execution like *Program Mode. *JOB » PGM .contains system fields having execution time information of the job e.constant context contains a literal value for non-status type fields System Contexts » JOB .particular field condition is specified as a value » CON .

any field in data dictionary Action Diagram Editor » allows modification of Action Diagram » line commands allow the modification TATA CONSULTANCY SERVICES COOL:2E Training 183 .g.Building Applications Action Diagrams Function Contexts » PAR .parameter fields as field values » WRK .program variables not declared as any context as field values e.

Building Applications Action Diagrams Action Diagram Editor » Line Commands * ** A B C CC D DD F FF H I+ I+F I* I*F Activate/Inactivate construct (Comment out) Place block Activate/Inactivate boundary Place copied or moved construct after this line Place copied or moved construct before this line Copy construct to a point indicated by 'A' or 'B' Place block Copy boundary Delete this construct Place block Delete boundary Edit action or condition details for line Edit action parameters Hide construct Insert *ADD built-in function Insert and Prompt *ADD built-in function Insert Comment Insert and Prompt Comment COOL:2E Training 184 TATA CONSULTANCY SERVICES .

Building Applications Action Diagrams Action Diagram Editor » Line Commands II-F I= I=A I=F IA IAF IC ICF II IIF IM IMF IO IOF Insert Insert Insert Insert Insert Insert Insert Insert Insert Insert Insert Insert Insert Insert Insert *SUB built-in function and Prompt *SUB built-in function *MOVE built-in function and Prompt *MOVE ALL built in function and Prompt *MOVE built-in fucntion Action and prompt Action Case condition and Prompt Case condition Iteration and Prompt Iteration Message function and Prompt Message function *OTHERWISE condition and prompt *OTHERWISE condition COOL:2E Training 185 TATA CONSULTANCY SERVICES .

Building Applications Action Diagrams Action Diagram Editor » Line Commands IS ISF IX IXF M MM NA NAA NI NR NRR S T U Z Insert Sequence Insert and Prompt Sequence Insert New condition within Case Insert and Prompt New condition within Case Move construct to a point indicated by 'A' or 'B' Place block Move boundary Copy to notepad & append to contents of notepad Place block notepad append boundary Insert entire contents of notepad after this line Copy to notepad & replace contents of notepad Place block notepad replace boundary Show construct Return to top level of action diagram Unzoom out of construct to previous construct Zoom into construct COOL:2E Training 186 TATA CONSULTANCY SERVICES .

COBOL.Generating Applications COOL:2E Generator Generation » Data Model is translated into either DDS sources or SQL collections ± Access Paths into Physical and Logical files » COOL:2E functions are translated into HLL programs . RPG or both » Device designs attached to functions are generated as DDS sources of Display and Printer files » Compilation of generated code is automatically submitted TATA CONSULTANCY SERVICES COOL:2E Training 187 .

take option for displaying all access paths or all functions » Take option J(batch) or G(online) for the item that has to be generated TATA CONSULTANCY SERVICES COOL:2E Training 188 .Generating Applications COOL:2E Generator Generating Code » from the Services Menu.

COOL:2E/1E Utilities Menus COOL:2E/1E Menus » dynamic menu system » removes the need of individual OS/400 display file for each application menu » Menus stored in special form and displayed using COOL:2E commands YWRKMNU & YGO » Menus are stored in a database file member » YDSNMNU is the default menu file supplied with COOL:2E/1E TATA CONSULTANCY SERVICES COOL:2E Training 189 .

COOL:2E/1E Utilities Menus COOL:2E/1E Menus » YCRTDSNF command can create a new design file » YADDDSNFM adds new member to design file » 2 types of COOL:2E menus ± Single option ± Multiple option TATA CONSULTANCY SERVICES COOL:2E Training 190 .

Sign up to vote on this title
UsefulNot useful