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.

OS2200 File Cyles

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

Numbering

In an OS2200 migrated application the F-cycle is a 3 digit number (001 to 999). When the F-cycle is 999 and the next F-cycle is created (+1) the F-cycle will restart at 001 (000 is not used).

File Naming

When an F-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>_nnn, where nnn is the F-cycle number for this F-cycle.

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

 

Cycle Limit

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

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

For an OS2200 migrated application the maximum Cycle Limit is 32 F-cycles.

The Comscript FileObject functions CreatFileCycle and ChangeCycle do not check on the maximum Cycle Limit, but for correct functioning the maximum of 32 should not be exceeded.

 

Referencing

F-Cycles can referenced by adding the F-Cycle number to the used Filename between parenthesis. I.e <Filename>(<F-Cycle>). There are two ways to pass the <F-Cycle> number: Absolute and Relative.

Relative

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

Normally the cycle limit is 32 and the lowest relative cycle number is therefore (-31).

The only positive relative cycle number is (+1) and can only be used when creating the next F-Cycle. The current F-Cycle number will then be increased by 1.

Absolute

Absolute F-Cycles are used when setting the absolute F-Cycle number between parenthesis after the filename. I.e. <Filename>(<Abs Cycle Number>).

Using absolute F-Cycles is not advised since this can only be done when it is certain that the absolute F-Cycle number used is within the set of available consecutive F-Cycle numbers. Which can change dynamically during the execution of the script.