Rational Developer for System z

Insertion of specific code in a Macro

You can insert specific code in a Macro which is called in a Business Component of server type. You must open the Macro in a PDP Macro editor in a server model to use the insertion wizards which help you insert specific code at different levels of the Business component (in the general process, in the Logical Views, in the Logical access, and the physical access).

Insertion at the level of a general process

This option corresponds to the insertion relative to the 05 hierarchical level processing

Function code
Create a function by entering a 2-character code, free (except 80 and 81).
Block
Check one of the block option:
  • Server initialization,
  • Logical View,
  • Server end.
If you check Logical View, you must enter the Segment code so as to position the procedure in the Logical View.
Insert type
Specific code must be inserted in the automatic functions, relatively to one of the Block selected in the Block field of the wizard, either before, after, or in replacement of a standard procedure.

Insertion in a logical view process

The wizard which opens when you select Insertion in a logical view process is used to insert specific procedures in the elementary procedures called by PERFORM. The insertion of specific procedure is done just after the tag which is automatically generated.

Function code
To add specific procedures to a Logical View, you must first identify it. To do so, create a function by entering: a 2-character code, free (except 80 and 81).
Subfuntion code
You position each specific procedure to be added, relative to a standard procedure of the Logical View. Create a subfunction, defined by a 2-character code, free.
Level
Indicate a hierarchical level equal to or greater than that of the standard procedure, necessarily higher than 05 and lower than 99. For a LOCK service, it must be necessarily higher than 10.
Process type
You find all the standard procedures related to the implementation of this Logical View's services. Select the type of process to relative to a standard procedure of the Logical View (each one of these standard procedures is associated with only one Logical View). When you select some of the processes, other fields are activated in the wizard. You will have to complete the options required for each type of process. The following table gives you the list of the processes which can be inserted at the level of a Logical View, it gives you their characteristics and it indicates the other fields which must be completed.
Table 1. Process type
Process type Comments Other fields to complete
BEGV: Logical view beginning   Insert type
CCNX: Connect to database   Insert type
CHKD: Check data A check service is needed when you want to check only the data entered by the end user and to send him/her an error message if the value entered is incorrect. Logical View's data are not transferred to the database. The check and update service performs the data transfers from the Segment to the Logical View. The Segment used as reference for the check must be associated with the Logical View, so you need to indicate the code of the Segment. Data Element code, Category, Insert type
CHUP: Check and/or update The check and/or update processing is used to check the user data, to present the information in the Business Component in the sepcified format, and to refresh the information by user input, through database updates. If you insert specific code at this level, it will be used for all the check/update services of the Logical View. It is the most generic specific code. Service, Insert type
CLOS: Close   Insert type
DCNX: Disconnect from database   Insert type
ENDV: Logical view ending   Insert type
LOCK: Lock The Lock/Unlock service allows you to prevent the update for a set of data to avoid simultaneous update, i.e to avoid inconsistency. Insert type
OPEN: Open Open indexed files in the View. You must indicate the file code (Data Structure code) in the dedicated field of the wizard Insert type, File code
SELC: Selection To replace the selection processing service on the Logical View in the category of your choice. You must also choose the type of service and the type of elementary processing. Service, Elementary process type, Category, Insert type
TRDT: Transfert View -> Segment For the transfer of data from the view toward the access Segments. Category, Insert type
TRER: Errors transfer Retrieval of errors during the call of a second-level Business Component. You can enter the code of the Segment where the error is detected, in the dedicated field. Segment code, Insert type
TRVW: Transfer Segment -> View The second-level Business Component exucutes the data transfer from the Segment to the Logical View. Category, Insert type
UNLK: Unlock Insertion of a lock service in the Business Component. Insert type
USER: User service Possibility for a Client component to call a special service (called 'User Service'), other than a selection or check/update service (ex: counter to count the number of customers per day who have issued an order, print service). The Business Component retrieves, through the communication area, the name and code of the User Service called by the Client component. User service code, Insert type
Service
This option is available only if you have selected 'CHUP' (Check/update) or 'SELC' (Selection) in the Process type field above. Check/update services are services in reception: they retrieve the data entered in the Client component (via the Logical View) and compares it to the data in the base (via a Segment) for check or update.
Select a value
For a check/update service, you can select one of the following services:
  • SRVE: Check service,
  • SRVL: Read service,
  • SRVM : Check/Update* service,
  • SRVT: Check/update/selection service,
  • SRVX : Check/selection service.
* For a Selection process, the only possible service is SRVA: Selection service.
Parameter
You can define a parameter for the service selected so as to identify this service in several servers for example. You can enter a parameter with a code made of two characters with the following format: $n (n being numbers from 1 to 0 or letters from A to J).
Elementary process type
The elementary procedures are executed by individual PERFORM from the ‘Logical View' level. This field only displays if you have selected 'CHUP' (Check/update) or 'SELC' (Selection) in the Process type field above.
Select a value
The choices in this field are available only for a 'CHUP' or 'SELECT' process. Moreover, they can be different from one service selected to another for a 'CHUP' process. The following table identifies the elementary process availability for each type of services selected:
Table 2. Elementary process availability
Generated services None: no elementary process INIT: initialization CHCK: check TRAN: transfer UPDT: update DONE: end SELC: selection
SRVE: Check service * * *     *  
SRVL: Read service * * * *   *  
SRVM: Check/update service * * * * * *  
SRVT: check / update and selection service * * * * * *  
SRVX/ Check/selection service * * *     *  
SRVA: Selection service * *   *   * *
None * * *   * *
Parameter
A parameter can be defined for the elementary process selected, you must then enter a code in two characters with the $n format.
File code
This field is available only for an 'OPEN' or 'CLOS' (Close) process. You must enter the code of the file, which consists of the first two characters of the Segment in a 'S' type Screen.
Segment code
The Segment code is required only for the error transfers, when you select the 'TRER' process. You must enter the code of the Segment where the error is detected in four characters.
User service code
This field is available only for a USER process (User service). You must enter the code of the User Service with maximum number of 25 characters.
Data Element code
This field must be completed for data check on the Logical View's Data Elements ('CHKD' process). Enter the code of the Logical View's Data Element which is checked.
Category
The choices available in this field are dedicated to the 'CHKD' (Check data), 'CHUP' (Checkand/or update), 'TRVW' (Transfer Segment -> View) and 'TRDT' (Transfer View -> Segment) and SELC (Select) types of process. Select a category among the following ones:
  • Initialization,
  • Iterative, for a multi-occurrence Logical View, this category performs an iterative access to the records.
  • End.
You can however enter a parameter for a category whatever the process can be. You must enter then two characters in the input field associated to the Parameter check box.
Insert type
Then, for each specific procedure to be inserted, you specify the procedure relative to a standard procedure of the Logical View by using a specific structure:
Begin
at the beginning of a standard procedure, just after the beginning tag. This setting is possible for performed procedures only. The choice is available only for the following selected types of processs: 'CCNX', 'CHKD', 'CLOS', 'SCNX', 'OPEN', 'TRDT', 'TRER' or 'TRVW'.
Before
Before (ante) the tag of the standard procedure.
After
After (post) the standard procedure: just before the end tag, if the hierarchical level is higher than that of the standard procedure; or just after the end tag, if the hierarchical level is equal to that of the standard procedure.
Replace
in replacement of the standard procedure.
Insert
This choice is specific to the User service process. It implies the insertion of the user service process at the level of the Logical View, that is to say, in any subfunction which depends on a 05 function.

Insertion at the level of a logical access

Function code
Enter a code in two free characters (except 80 and 81) to create a function.
Subfunction code
Enter the code of the subfunction in two characters. It can be constituted of letters or numbers. This code determines the position of the source lines in the function.
Level
The level is used to set a hierarchy between subfunctions in a function. A subfunction is lower than another one if its level number is higher. The level of a function and a subfunction is identiifed by a blue number in the Macro tags tree, it is displayed at the level of the function line in the tree. The possible values for each level are the following ones: :
  • 05: default level for all functions.
  • 10: default level for a subfunction.
  • 06 to 98: possible levels for a subfunction. A subfunction is lower than another one if its level number is higher.
    Remarque : In a function, a subfunction with a level 15 is dependent on the subfunction with a level 06 to 14 which precedes it.
  • 99: this level is dedicated to the elementary processes. It is used to write a condition with no use of creating a new subfunction. This level can contain no more than 75 lines. A subfunction is limited to 98 of this level.
A subfunction is executed only if all the functions and subfunctions which it depends on are executed.
Segment code
Enter the code of Segment in four characters.
Process type
In a Logical View processing, there are three possible process types:
  • CHCK: Check, relative to the level 10 for check/update service, relative to the level 15 for check/update processing by category relative to the level 20 for check/update processing by category and service type.
  • SLCT: Selection relative to the level 10 for the access to a Segment for data selection, relative to the level 15 for the access to a Segment for data selection by category, relative to the level 20 for the access to a Segment for data selection by category and elementary service type.
  • UPDT: Update, relative to the level 10 for the access to a Segment for data check and update, relative to the level 15 for the access to a Segment for data check and update by category, relative to the level 20 for the access to a Segment for data check and update by category and elementary service type.
Elementary process type
Select a value
Select an elementary process (ALIM for keys alimentation, CALL for the call of physical processing, or ERRS for error handling.
Parameter
You can enter a parameter for the elementary process selected in a format $n.
Category
Read the details on the same field in the 'Insertion in a logical view process' section above.
Insertion type
Read the details on the same field in the 'Insertion in a logical view process' section above. The level 10 is not required for 'before' and 'after' types for the logical access to Segments.

Insertion at the level of a physical access

The wizard Insertion at the level of a physical access is used to enter specific code in the Segment logical access. Physical accesses are generated in function 80.
Note: The physical accesses to data make up a third processing level. A physical access is performed for each Segment logical access. The generated physical access depends on the constant data storage structure. Changing the physical storage mode of data does not modify the logical structure of the Business Component.
The function 80 of the Business Component is structured in subfunctions: one subfunction per Segment and per access type.
Function code
The first two characters of the function is 80.
Subfunction code
To create a subfunction 80, enter two non-numerical characaters.
Level
Enter a 10 hierarchical level, identical to that of the standardly generated subfunction.
Segment code
Enter the code of the accessed Segment in four characters. For customized SQL accesses, this is the code of the relational table Segment.
Extract method
Enter the name of the extraction method (in uppercases) if selection criteria are to be taken into account.
Access type
To replace a standard subfunction, if the Segment code is followed by the access type, only the sub-function corresponding to the access type is replaced. If the access type is not specified, all the access sub-functions to this Segments will be replaced.
Select a value
Select a standardly generated access type, if you want to complete it with a customized access. With relational databases, you can customize SQL accesses in order to:
  • add or replace clauses in a standardly generated access or create a new physical access.
  • take into account the selection criteria used by an extraction method.
Values for calling server
Check the option to be able to select the type of general processing:
  • ALIM: Alimentation before call, for loading of communication area,
  • CALL: Call server, for the call of Business Component,
  • RETC: Return after call server, for processing at the Business Component return.
Parameter
You can enter a parameter for the access type, to do so, enter two characters in the $n format.
Action type
Specific procedure in function 80 is inserted by relative positioning: with a Replace structure type, to replace a standard subfunction, with an Insertstructure type, to complete or create an SQL access.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)