Structure Expansion Tokens

 

Structure expansion tokens are expansion tokens that are used to insert information about the current Repository structure into the output stream. They can be used anywhere in a template file.

Structure Token

Description

<DATA_FIELDS_LIST>

Inserts a comma-separated list of a structures data fields (i.e. non primary key) fields. This is mainly useful for defining sets in UI Toolkit input windows, as any field marked “Excluded by Toolkit” will NOT be included in the list of fields.  Array fields are listed separately with real a real array index.

Example output: FIELD1,FIELD2,FIELD3[1],FIELD3[2],FIELD4

<DISPLAY_FIELD>

Inserts the name of the structures display field, if defined. A structures display field is defined by adding the text @CODEGEN_DISPLAY_FIELD to the fields user defined text string or long description.

CodeGen will display an error if it encounters this token and the structure being processed does not have a display field defined.

Example output:  DEPARTMENT_NAME

<FIELD_PREFIX>

 

Inserts the current field prefix that was specified via the -prefix command line option. If the -prefix command line option was not used then this the token does not write anything to the output file.

 

<FILE_ADDRESSING>

Inserts the addressing size of the structures first assigned data file.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Possible values:  32, 40

<FILE_CHANGE_TRACKING>

Inserts a string indicating whether the structures first assigned file has change tracking enabled.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

This option is supported by Synergy/DE V10.1 and higher.

Possible values:  YES, NO

Alternates: <file_change_tracking>

<FILE_COMPRESSION>

Inserts a string indicating whether the structures first assigned file has data compression enabled.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Possible values:  YES, NO

Alternates: <file_compression>

<FILE_DENSITY>

Inserts the default key density of the structures first assigned file.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Possible values:  50, 100

<FILE_DESC>

Inserts the description of the first data file assigned to the structure. For example:

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Example Output:  Customer Master File

<FILE_ISAMC_SPEC>

 

Inserts an ISAMC file specification string based on the file attributes defined in the first file assigned to the structure.

 

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Example output: DATA:EMPLOYEE.ISM,FIXED,COMPRESS,DENSITY=50,PAGE=1024

See also: <KEY_ISAMC_SPEC>

<FILE_NAME>

Inserts the name of the first data file assigned to the current structure.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Example output:  DAT:customer.ism

<FILE_NAME_NOEXT>

Inserts the name of the first data file assigned to the current structure, with the file extension removed. This token can be useful when constructing file specifications where the file extension is based on a variable company code or other data.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Example output:  DAT:customer

<FILE_ODBC_NAME>

 

Inserts the ODBC table name of the first repository file definition that is assigned to the structure currently being processed. If no ODBC table name is specified then the name of the first assigned structure is used.

 

Example output:  CUSTOMER

Alternates:  <file_odbc_name> <File_Odbc_Name> <File_odbc_name> <FileOdbcName> <fileOdbcName>

<FILE_PAGESIZE>

Inserts the page size of the current structures first assigned file.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Possible values:  512, 1024, 2048, 4096, 8192,16384, 32768

Note: Page sizes 16384 and 32768 were introduced with ISAM Rev 6 in Synergy/DE 10.1

<FILE_PORTABLE_INT_SPECS>

 

Inserts the portable integer positions string of the first data file assigned to the current structure.

 

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

<FILE_RECTYPE>

Inserts a string indicating the record type of the first data file assigned to the structure.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Possible values:  FIXED, VARIABLE, MULTIPLE

Alternates: <file_rectype>

<FILE_RPS_NAME>

 

Inserts the name of the first repository file definition that is assigned to the structure currently being processed.

 

Example output:  CUSTOMER

Alternates:  <file_rps_name> <File_Rps_Name> <File_rps_name> <FileRpsName> <fileRpsName>

<FILE_STATIC_RFA>

Inserts a string indicating whether the structures first assigned file has static RFA’s enabled.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Possible values:  YES, NO

Alternates: <file_static_rfa>

<FILE_STORED_GRFA>

Inserts a string indicating whether the structures first assigned file has stored GRFA’s enabled.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Supported in Synergy/DE V10.1 and higher.

Possible values:  YES, NO

Alternates: <file_stored_grfa>

<FILE_TYPE>

Inserts a string indicating the type of the first data file assigned to the structure.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

Possible values:  ASCII, DBL ISAM, RELATIVE, USER DEFINED

<FILE_UTEXT>

Inserts the user text string of the first data file assigned to the structure.

CodeGen will display an error if it encounters this token and the structure being processed has not been assigned to a repository file definition.

<MAPPED_FILE>

Inserts the file specification of the first file assigned to the mapped structure.

To use this token you must be processing a structure which has been mapped to a second structure, and the second structure must have been assigned to a repository file definition.  CodeGen will display an error if it encounters this token and these requirements have not been satisfied.

For information on structure and field mapping, refer to Preparing Your Repository.

Example output:  DAT:department.ism

<MAPPED_STRUCTURE>

Inserts the name of the mapped structure. To use this token you must be processing a structure which has been mapped to a second structure. CodeGen will display an error if it encounters this token and you are not processing a structure with a structure mapping.

For information on structure and field mapping, refer to Preparing Your Repository.

Example output:  DEPARTMENT

Alternates: <mapped_structure>

<MAPPED_TAG_FIELD>

Inserts the name of the name of the first tag field in the mapped structure.

To use this token you must be processing a structure which has been mapped to a second structure, and that structure must have a tag. CodeGen will display an error if it encounters this token and you are not processing a structure with a structure mapping.

For information on structure and field mapping, refer to Preparing Your Repository.

Example output:  DEPARTMENT_ID

Alternates: <mapped_tag_field>

<PRIMARY_KEY_FIELD>

Inserts the name of the first segment of the structures primary key.

WARNING: This token does not support structures with segmented primary keys.  You can achieve more flexible results by using a key segment loop within a primary key block.  This technique is discussed later in this chapter.  This token is present for compatibility with older template files only, and will be removed in a future version.

Example output:  CUSTOMER_ID

Alternates:  <primary_key_field> <Primary_Key_Field> <Primary_key_field> <PrimaryKeyField> <primaryKeyField>

<STRUCTURE_#n>

This special token switches context to a different structure, and can only be used when processing multiple structures concurrently. The n character represents the one-based index number of the structure to switch to, and must be a number between 1 and the number of structures being processed.

CodeGen can process multiple structures concurrently in one of two ways:

Multiple structures can be specified on the command line, after the -s command line option, and the -ms command line option can be used to specify that all of the structures are to be processed together.

The -file command line option can be used to use a repository file definition as the starting point for code generation, and that file definition can have multiple structures assigned.

This token does not cause any data to be written to the output stream.

For an example of processing multiple structures in a single template file, refer to the example template named xf_net_get_master_detail.tpl.

<STRUCTURE_CHILDREN>

Inserts the number of the structures first level child members (fields and groups).

Example output:  15

<STRUCTURE_DESC>

Inserts the current structures description.

Example output:  Customer Master Record

<STRUCTURE_FIELDS>

Inserts the total number of fields in the structure. If the structure includes any array fields then the individual array field elements are counted towards the number of fields in the structure.

Example output:  25

<STRUCTURE_FILES>

 

Inserts the number of repository file definitions that the current structure is assigned to.

 

Example output:  1

<STRUCTURE_KEYS>

Inserts the total number of keys defined in the structure.

Example output:  3

<STRUCTURE_LDESC>

Inserts the structures long description.

<STRUCTURE_NAME>

Inserts the name of the structure that is currently being processed. If the -a command line option is being used then inserts the structures alias as specified on the command line. If you are using structure aliases and want to insert the name of the actual structure (not the alias) then use the <STRUCTURE_NOALIAS> token. 

Example output:  CUSTOMER

Alternates:  <structure_name> <Structure_Name> <Structure_name> <StructureName> <structureName>

See also:  <STRUCTURE_NOALIAS>, <STRUCTURE_NOPLURAL>, <STRUCTURE_PLURAL>

<STRUCTURE_NOALIAS>

Inserts the name of the Repository structure that is currently being processed. This token is always replaced by the actual name of the repository structure, even if the -a command line option is being used.

Example output:  CUSTOMER

Alternates:  <structure_noalias> <Structure_Noalias> <Structure_noalias> <StructureNoalias> <structureNoalias>

See also:  <STRUCTURE_NAME>, <STRUCTURE_NOPLURAL>, <STRUCTURE_PLURAL>

<STRUCTURE_NOPLURAL>

 

Inserts the name of the structure that is currently being processed. If the -a command line option is being used then inserts the structures alias as specified on the command line. If the name ends with an "S" character then it will be removed.

 

Example output:  For a structure named CUSTOMERS the token will insert CUSTOMER

Alternates:  <structure_noplural> <Structure_Noplural> <Structure_noplural> <StructureNoplural> <structureNoplural>

See also: <STRUCTURE_NAME>, <STRUCTURE_NOALIAS>, <STRUCTURE_PLURAL>

<STRUCTURE_PLURAL>

 

Inserts the name of the structure that is currently being processed. If the -a command line option is being used then inserts the structures alias as specified on the command line. If the name does not end with the character "S" then one will be added.

 

Example output: For a structure named CUSTOMER the token will insert CUSTOMERS

Alternates:  <structure_plural> <Structure_Plural> <Structure_plural> <StructurePlural> <structurePlural>

See also:  <STRUCTURE_NAME>, <STRUCTURE_NOALIAS>, <STRUCTURE_NOPLURAL>

<STRUCTURE_SIZE>

Inserts the size of the current structure expressed in bytes.

Example output: 495

<STRUCTURE_TYPE>

 

Inserts the type of the current structure.

Possible values:  ASCII, DBL ISAM, RELATIVE, USER DEFINED

<STRUCTURE_UTEXT>

Inserts the structure user text string.

 

 


Copyright © 2021  Synergex International, Inc.