You are here: Job and Form Set Rules Reference > JDT Rules Reference > PreTransDAL

PreTransDAL

Use this form set level rule in the AFGJOB.JDT file to execute a DAL script on the PRE_PROC_A message. The PreTransDAL rule executes before other form set rules and before section rules.

You can use this rule to handle setup tasks which should occur before form set rules and section rules are executed. For example, you can use this rule to initialize GVM and internal DAL variables.

Syntax

;PreTransDAL;;string;

Parameter

Description

   

String

A character string that contains a DAL function or script.

Although you can use DAL to access almost any form set or section field, keep in mind those fields may not exist, depending on where you place this rule in the transaction job rule list. And, unlike the DAL or IF rules, there is no return value from the execution of a transaction level DAL script.

Use this form to get extract data if the script is contained in the rule data. You cannot use this form in external script files.

A = {1,MIS257 138,1}

Where A is a DAL variable you wish to assign. The bracketed {} item can be almost any standard search mask supported by the Get Record infrastructure. In this case, 1,MIS257 is the search criteria. If the record is found, the system takes the data from position 138, length 1 as indicated by 138,1.

This method also lets you specify an occurrence of the record by including a hyphen with a numeric value, such as -n, after the data length. Here is an example:

A = {1,MIS257 138,1-5}

Here the function searches for the 5th occurrence of the 1,MIS257 record. If you omit the occurrence, the system returns the first one found. If it cannot find the requested record, the system assigns the variable an empty “” value.

     
Note To specify multiple DAL statements in the rule data area, separate the DAL statements using two colons (::). Normally, semicolons separate DAL statements, but this character is illegal in the rule data area.

Example

;PreTransDAL;; trans_id={1,PrePost 1,8}::Chain("pretrans.dal");

This example sets the internal DAL variable, trans_ID, to the first eight-characters from the transaction record that matches the search mask: 1,PrePost. Then the Chain DAL function executes the DAL script in the PRETRANS.DAL file in the DefLib directory specified in your MRL.

;PreTransDAL;;If (HaveGVM("main")) Then SetGVM("main_address", "25 Brown St.", , “C”, 20)::End;

In this example, DAL checks to see if the GVM variable (main_address) exists. If not, it creates a character array GVM variable (main_address) 20 characters in length and stores the character string (25 Brown Street) in the array.

See also