TEMPLATE
Describe a template definition
TEMPLATE name [PARENT template] TYPE type SIZE size [STORED store_format] [ENUM name] [NODATE] [NOTIME] [USER TYPE "user_type"] [NOUSER TYPE] [PRECISION dec_places] [DIMENSION #elements[:#elements ...]] [LANGUAGE VIEW] [LANGUAGE NOVIEW] [SCRIPT VIEW] [SCRIPT NOVIEW] [REPORT VIEW] [REPORT NOVIEW] [WEB VIEW] [WEB NOVIEW] [COERCED TYPE type] [NOCOERCED TYPE] [OVERLAY field[:offset]] [NONAMELINK] [DESCRIPTION "description"] [NODESC] [LONG DESCRIPTION "long_desc"] [NOLONGDESC] [POSITION [pos_type] row column] [NOPOSITION] [FPOSITION [fpos_type] frow fcolumn] [NOFPOSITION] [PROMPT "prompt"] [NOPROMPT] [HELP "help"] [NOHELP] [INFO LINE "info_line"] [NOINFO] [USER TEXT "user_text"] [NOUSER TEXT] [FORMAT format] [NOFORMAT] [REPORT HEADING "heading"] [NOHEADING] [ALTERNATE NAME alt_name] [NOALTERNATE NAME] [REPORT JUST just] [INPUT JUST ijust] [BLANKIFZERO] [NOBLANKIFZERO] [PAINT "paint_char"] [NOPAINT] [RADIO|CHECKBOX] [NORADIO] [NOCHECKBOX] [FONT font] [NOFONT] [PROMPTFONT prompt_font] [NOPROMPTFONT] [READONLY] [NOREADONLY] [DISABLED] [NODISABLED | ENABLED] [COLOR palette#] [NOCOLOR] [HIGHLIGHT] [NOHIGHLIGHT] [REVERSE] [NOREVERSE] [BLINK] [NOBLINK] [UNDERLINE] [NOUNDERLINE] [NOATTRIBUTES] [DISPLAY LENGTH length] [NODISPLAY LENGTH] [VIEW LENGTH length] [NOVIEW LENGTH] [UPPERCASE] [NOUPPERCASE] [NODECIMAL] [DECIMAL_REQUIRED] [NOTERM] [TERM] [RETAIN POSITION] [NORETAIN POSITION] [DEFAULT default|COPY|INCREMENT|DECREMENT] [NODEFAULT] [AUTOMATIC] [NOAUTOMATIC] [NOECHO] [NOECHOCHR "display_char"] [ECHO] [DATE TODAY] [DATE NOTODAY] [DATE SHORT] [DATE NOSHORT] [TIME NOW] [TIME NONOW] [TIME AMPM] [TIME NOAMPM] [WAIT "time"|WAIT IMMEDIATE|WAIT GLOBAL|WAIT FOREVER] [NOWAIT] [INPUT LENGTH length] [NOINPUT LENGTH] [BREAK [break_type]] [NOBREAK] [REQUIRED] [NOREQUIRED] [NEGATIVE [ONLY|ORZERO]] [NONEGATIVE] [NULL ALLOWED|NULL DEFAULT|NONULL] [ALLOW entry[, ...]] [NOALLOW] [MATCH CASE] [MATCH NOCASE] [MATCH EXACT] [MATCH NOEXACT] [SELECTION LIST sl_row sl_column sl_height ENTRIES sl_entry[, ...]] [SELECTION WINDOW sw_row sw_column sw_name] [NOSELECT] [ENUMERATED length base step] [NOENUMERATED] [RANGE min max] [NORANGE] [ARRIVE METHOD arrive_method] [NOARRIVE METHOD] [LEAVE METHOD leave_method] [NOLEAVE METHOD] [DRILL METHOD drill_method] [NODRILL METHOD] [HYPERLINK METHOD hyperlink_method] [NOHYPERLINK METHOD] [CHANGE METHOD change_method] [NOCHANGE METHOD] [DISPLAY METHOD display_method] [NODISPLAY METHOD][EDITFMT METHOD editfmt_method] [NOEDITFMT METHOD]
Arguments
See FIELD for a description of the arguments not listed here, but note that Struct is not a supported data type for templates.
name
The name of a new or existing template. This name can have a maximum of 30 characters.
PARENT template
(optional) Assigns the specified parent template to the current template. (A parent is to a template what a template is to a field.) All template attributes, including type and size, are obtained from the specified parent template. The maximum size of the parent name is 30 characters. If a parent is assigned to a template and none of the parent’s attributes are overridden in the template, no additional keywords are required. The Synergy Data Language assumes that any keywords specified in addition to the parent name are overrides to the parent.
Discussion
The TEMPLATE statement is used to describe a template. A template is a set of field characteristics that can be assigned to one or more field or template definitions.
If global formats are contained within the same schema file as a template, they must be defined before the template. Any structures must be defined following the template.
The maximum number of fields that can use the same template is 6,000. The maximum number of templates that can use the same parent template is 3,000.
Adding new definitions
You can define a maximum of 9,999 templates.
Replacing existing definitions
All required keywords and data must be specified. The existing template is cleared and set to the specified attributes.
Overlaying existing definitions
Name must be respecified along with the desired attributes. The current template attributes are overwritten with any new attributes that are specified. When a parent is added to an existing template, both the existing override flags and the template attributes that are explicitly specified in the schema are retained as parent overrides.
Keep in mind that items such as allow list or selection list entries are specified by a single keyword. Hence, to change one allow list entry, you must respecify all allow list entries.
Examples
TEMPLATE amount TYPE decimal SIZE 6 PRECISION 2 DESCRIPTION "Implied-decimal amount" TEMPLATE date8 TYPE date SIZE 8 STORED YYYYMMDD DESCRIPTION "Four-digit year" LONG DESCRIPTION "Four-digit year (YYYYMMDD)" FORMAT "#03 MM-DD-YYYY" DATE TODAY TEMPLATE color TYPE alpha SIZE 6 DESCRIPTION "Order item color" POSITION relative 4 4 PROMPT "Enter desired color: " ALLOW red,blue,yellow,green TEMPLATE date_mmddyyyy PARENT date8 DESCRIPTION "Date formatted MM-DD-YYYY"