The following is an example of the Display All Functions panel:
The Synon/2E shipped files contain all of the default shipped data such as built-in functions, arrays, field types, job data, messages, program data, and standard headers/footers. The shipped files hold information that you use or reference in the application during the function building process.
Understanding Database Functions
Database functions provide the means of performing actions on the database.
There are four different database functions, each defining a HLL subroutine to either create, change, delete, or retrieve data. Database functions are implemented as part of an external standard function.
The four database functions are:
· Create Object (CRTOBJ) This function defines a routine to add a record to a file. It includes processing to check that the record does not already exist before writing to the database.
· Change Object (CHGOBJ) This function defines a routine to update a record on a file. It includes processing to check that the record already exists before updating the database record.
· Delete Object (DLTOBJ) This function defines a routine to delete a record from a database file. It includes processing to check that the record is still on the file before deleting it.
· Retrieve Object (RTVOBJ) This function defines a routine to retrieve one or more records from a database file. Processing may be specified for each record read by modifying the action diagram for the function.
A default version of the Create, Change, and Delete database functions is defined for all database files (REF and CPT). You must create the Retrieve Object function if you need it.
Array Processing
To add, delete, modify, or retrieve entries in a particular array over which they are defined, use the following database functions:
· Create Object (CRTOBJ)
· Delete Object (DLTOBJ)
· Change Object (CHGOBJ)
· Retrieve Object (RTVOBJ)
A DLTOBJ with no parameters clears an array. Although arrays are not implemented as database files, Synon/2E allows you to use the same techniques as database files when working with arrays. Note that you must define a key for an array even if the array holds a single element.
The device standard header device functions are:
· Define Screen Format (DFNSCRFMT) This function allows you to define a standard screen header and footer for use by other functions that have screen designs attached to them.
· Define Report Format (DFNRPTFMT) This function allows you to define a standard report header and footer for your Print File report functions.
The single-record device functions are:
· Prompt Record (PMTRCD) This function defines a program to prompt for a list of fields defined by a specified access path. The validated values can be passed to any other function.
· Display Record (DSPRCD) This function defines a program to display a single record from a specified database file. If no key is supplied, a key panel prompts for a key.
· Display Record 2 panels (DSPRCD2) This function defines a program which is identical to the DSPRCD function, except that it allows the database record details to extend to two separate display device pages.
· Display Record 3 panels (DSPRCD3) This function defines a program which is identical to the DSPRCD function, except that it allows the database record details to extend to three separate display device pages.
· Edit Record (EDTRCD) This function defines a program to maintain (add, change, and delete) records on a specified file, one at a time. If no key is supplied, a key panel prompts for a key.
· Edit Record 2 panels (EDTRCD2) This function is identical to the Edit Record function, except that it allows the record details to extend to two separate display pages.
· Edit Record 3 panels (EDTRCD3) This function is identical to the Edit Record function, except that it allows the record details to extend to three separate display pages. The multiple-record device functions are:
· Display File (DSPFIL) This function defines a program to display the records from a specified file, many at a time, using a subfile. The subfile is loaded a page at a time when you press Rollup or F8.
· Select Record (SELRCD) This function defines a program to display the records from a specified file, many at a time, using a subfile. The program allows you to select one of the records. The selected record will be returned to the calling program. This function is called from a function that has requested a selection list.
· Edit File (EDTFIL) This function defines a program to maintain the records on a specified file, many at a time, using a subfile. The subfile is loaded a page at a time when you press Rollup or F8.
The single- and multiple-record device functions are:
· Display Transaction (DSPTRN) This function defines a program to display the records from a specified pair of database files. The pair must be connected by an Owned by or Refers to relation.
· Edit Transaction (EDTTRN) This function defines a program to maintain the records on a specified pair of header and detail files. The pair must be connected by an Owned by or Refers to relation.
The printer device functions are:
· Print File (PRTFIL) This function defines a program to print records from a specified access path.
· Print Object (PRTOBJ) This function defines a particular report fragment which will print the records from a specified access path at any point within a Print File function. Print Object functions can be embedded within other Print Object functions.
Understanding User Functions
User functions provide the means of implementing additional user processing within an existing function or as an independent implementation used in conjunction with an existing function.
There are four basic user functions: Execute Internal Function, Execute External Function, Execute User Source and Execute User Program.
The free-form functions are:
· Execute Internal Function (EXTINTFUN) This function allows you to specify a section of an action diagram for repeated use in other functions.
· Execute External Function (EXCEXTFUN) This function allows you to specify a HLL program using an action diagram.
Defining User Coded Functions
User coded functions are functions that are user-written in a HLL. They can be called from another function or embedded within a function.
The user-written coded functions are:
· Execute User Program (EXCUSRPGM) This function allows you to describe the interface to a user written HLL program so that it can be referenced by functions. Parameters can be specified on the call.
· Execute User Source (EXCUSRSRC) This function specifies that user-written HLL code to perform an arbitrary function is to be included within the source generated by Synon/2E for an HLL program
You define these function types at the Edit Functions panel. The user-coded functions are called or referenced by any function. However, they do not have an associated action diagram. You can edit the source directly from within Synon/2E.
An EXCUSRPGM function generally is an existing program that you integrate into your application. This process will typically require you to rename the default name for the function to the name of the existing user program. DDS names must match for EXCUSRPGM or source copied into functions.
EXCUSRSRC function types must be of the same HLL source type as that of any functions which call them.
Messages
Synon/2E provides you with standard message functions.
The message functions allow the user to
· define messages of varying types
· specify different message files to which the message is attached
· specify substitution variable parameters
· change message identifiers
The message functions are as follows:
· Send Error Message (SNDERRMSG) This function specifies that an error message is to be sent to a calling function. Normally, this function is used to provide diagnostic messages arising from user validation.
· Send Information Message (SNDINFMSG) This function specifies that an information message is to be sent to the message queue of a calling program.
· Send Completion Message (SNDCMPMSG) This function specifies that a completion message is to be sent to the function that called a standard function. Typically, completion messages are used to indicate that a process has completed successfully.
· Send Status Message (SNDSTSMSG) This function specifies that a status message is to be sent to a calling function. Normally, this function is used to provide information about the progress of a long-running process.
· Retrieve Message (RTVMSG) This function specifies that message text is to be retrieved from the message file into a function.
· Execute Message (EXCMSG) This function specifies that a request message is to be executed. The request may be any CL, OS/2, or UNIX command. You can specify a separate execution message for each of these platforms.
We can different types of message EXC, ERR, INF.
Selecting EXC message will implment EXCMSG function.
Understanding Function Fields
Function fields are special types of fields that you can use in device designs and action diagrams. The attributes of a function field are typically based on other fields
There are six different types or usages of function fields. The following four usages provide standard field level functions:
· Sum (SUM)
· Count (CNT)
· Maximum (MAX)
· Minimum (MIN)
The other two field usages allow you to define your own function fields, either with or without a user-specified calculation to derive the field. These function field usage types are:
· Derived (DRV)
· User (USR)
Derived (DRV) function fields must have one output parameter and can have many input parameters.
Maximum (MAX), Minimum (MIN), Count (CNT) and Sum (SUM) function fields must have only one output parameter (the field itself) and only one input parameter that defines a field upon which the calculation is based.
USR usage function fields have no associated parameters. These fields are typically used as work fields in an action diagram.
DRV usage function fields have associated action diagrams. A free-form action diagram shell (such as for EXCINTFUN) is associated with the derived function field to specify processing steps.
Accessing Messages File in Synon:
Type *Messages
Take Z on it. We can see all message
Take F9=Add message to add a new message