Functions

157 Views


A function defines a list of processes that will operate on the files and fields in your database.

CA 2E provides a variety of standard functions to which you can add your own unique processing.

The set of standard functions consist of database functions, device functions, and user functions.

A function can be implemented either as a separate program or as a subroutine within a program as follows:

■ An external function is implemented as a separate high-level language (HLL) program. Each external function is attached to an access path. In general, the standard device functions are external functions; for example, the Edit File function. The only exception is the Print Object (PRTOBJ) function that is covered in a later chapter of this tutorial.

■ An internal function is implemented as source code within that of the calling program; in other words, it is implemented as a subroutine. All the standard database functions are internal functions; for example, the Create Object function

A function is a unit of specification, not implementation.

Several internal functions may be implemented as a single program.

 

Components of a standard functions: (Note that not all function types have all four components)

■ Device design—Specifies the layout of the panel or report used by the function

■ Action diagram—Specifies the processing steps that make up the function (includes default processing and processing that you define)

■ Function options—Specifies default features of a function

■ Function parameters—Specifies fields to be passed into the function and returned from the function at run time

In addition to the standard functions, CA 2E provides message functions, function fields, and built-in functions, which perform low-level processing such as arithmetic operations. 

List of different Function Types:

Internal Functions:
Change object                       CHGOBJ   
Create object                         CRTOBJ   
Delete object                         DLTOBJ   
Retrieve object                      RTVOBJ   
Print object                            PRTOBJ  

External Functions (screens):
Display file                             DSPFIL   
Display record(1 screen)       DSPRCD   
Display record(2 screen)       DSPRCD2  
Display record(3 screen)       DSPRCD3  
Display transactions              DSPTRN   
Edit file                                   EDTFIL   
Edit record(1 screen)             EDTRCD   
Edit record(2 screens)           EDTRCD2  
Edit record(3 screens)           EDTRCD3  
Edit transaction                      EDTTRN   
Prompt & validate record       PMTRCD   
Select record                         SELRCD 

External Functions (non-screens):
Execute external function      EXCEXTFUN
Execute internal function       EXCINTFUN
Execute user program           EXCUSRPGM
Execute user source              EXCUSRSRC
Print file                                  PRTFIL     

CA 2E automatically creates five default functions for each reference file (REF) you declare: two external functions (Edit File and Select Record), and three internal functions (Change Object, Create Object, and Delete Object).

Note that for capture files (CPT), CA 2E automatically creates only the three internal functions (Change Object, Create Object, and Delete Object).

Take F on a file to access the functions which are created based on a particular file.

These are the functions based on this file:

These are the list of different type of functions:

 

Function  type Classification:
*EXT :  Function will be implemented as a s eparate program.    
*INT : Function  will be implemented as in-line code within a calling program.                                              
*DEV : Function type has a device file.                         
*DBF : Function type is a databse update routine.               
*USR : Function type is user defined.                           
*SCR : Function type has a screen device file.                  
*RPT : Function type has a report device file.                
*DSP : Function type is display only.       
*UPD : Function type updates the database.  
*WS  : Function type models a web service.  

 

Post Comments