AMT Help Files

File Cycles

The file cycle functions in the FileObject Interface are mainly to be used by the Script Libraries. It is strongly discouraged to use these functions directly in scripts. When however these functions are to be used directly more information on the usage can be found in this page.

IBM File Cycles

IBM File Cycles will be used when the migrated application originally ran on an IBM mainframe. Described below is the behaviour of the IBM File Cycles as implemented in the AMT ComScript FileObject interface.

Numbering

In an IBM migrated application the numbering of file cycles is split up in Generation and Versions.

Generations

The Generation number is a 4 digit number which will reach from 0001 to 9999. When the Generation is 9999 and the next Generation is created (+1) the Generation will restart at 0001 (0000 is not used).

Versions

Versions have defined by IBM but are not used. So the only version supported is version 00.

File Naming

When an IBM File cycle file is created using the absolute filename <Path>\<Filename>, the file is created in a special folder <Path>\<Filename>.AmtFileCycle\ and will be named <Filename>GnnnnV00, where nnnn is the Generation number for this IBM file cycle and the Version number is always V00 as explained above.

When creating an IBM File cycle using the ComScript FileObject function CreateFileCycle, the used fileName should always be a filename with an absolute path.

 

Cycle Limit

The Cycle Limit (IBM GDGLIMIT) defines the maximum number of consecutive File cycles that can exist. When the number of consecutive File cycles has reached the Cycle Limit and the next File cycle is created, the File cycle with the lowest number will be deleted.

The Cycle Limit must be set when creating a new File cycle using the Comscript CreateFileCycle FileObject function. The Cycle Limit can be changed without creating a new File cycle with the Comscript ChangeCycle FileObject function.

For an IBM migrated application the maximum Cycle Limit is 999 File cycles.

According to IBM documentation the original GDGLIMIT had a default value of 99 and a maximum allowed value of 255. Later on this was changed to 999.
The Comscript FileObject functions CreatFileCycle and ChangeCycle do not check on the maximum Cycle Limit, but for correct functioning the maximum of 999 should not be exceeded.

Referencing

File cycles can referenced by adding the File cycle number to the used Filename between parenthesis. I.e <Filename>(<File cycle>). There are two ways to pass the <File cycle> number: Absolute and Relative.

Relative

Relative File cycles are used by setting a negative relative File cycle number between parenthesis after the filename. I.e. <Filename>(-<Rel Cycle Number>). The relative cycle number is the offset to the current File cycle number, which is the highest File cycle number in the set of available consecutive File cycle numbers. E.g. when the current File cycle is 0101, (0) will refer to that File cycle and (-10) will be File cycle 0091.

Normally the cycle limit is set to 99 (IBM default) and the lowest relative cycle number is then (-98).

Positive relative cycle numbers can be used when creating new file generations. To create multiple new file generations of the same file inside a single script, the positive relative cycle number should be increased for every new generation e.g. <Filename>(+1), <Filename>(+2), etc. These new file generations can then be referenced inside that script by their positive relative cycle number. The current file cycle number for files will be updated after the script has been executed.

Absolute

Absolute File Cycles are used by adding the absolute File cycle number after the filename. See the File Naming section above for more information.

Syntax: <Filename>G<Abs Cycle Number>V00. 

Example: TEST_FILEG0123V00

Using absolute File cycles is not advised since this can only be done when it is certain that the absolute File cycle number used is within the set of available consecutive File cycle numbers. Which can change dynamically after the execution of the script.