Database Management > Managing Database Sequences > Maintaining Sequences Using CIM
  
Maintaining Sequences Using CIM
Sequences can be maintained using the CIM interface. The content of a sequence represents the last value applied to the sequence by a call from a function. This value is not available for processing, since it was consumed by another process.
Values used to update a sequence are validated against a range of acceptable values for the sequence. The value of the sequence can be within and including the boundary values. You receive an error message when the range is exceeded.
For more information on CIM, see Using the CIM Interface.
Limitations of CIM
Some limitations to maintaining sequences through the CIM interface are:
Sequence maintenance must be performed in a single-user mode Progress session. The integrity of the sequence value is not guaranteed if maintenance is done in multiple-user mode.
Destructive updates are not permitted. A CIM update cannot overwrite previously created files. Data dumping does not proceed if any elements in the set of sequences conflict with an existing OS file.
You cannot manually update from CIM. CIM is an automatic process.
Any error causes the sequence maintenance to fail. When you suspect a sequence maintenance activity failed while processing, you must repeat the entire process. This guarantees that the sequence values are valid.
Sample CIM File Format
A typical CIM file might look like the following example:
Line 1: <log file> <log directory>
Line 2: <sequence name>
Line 3: <action>
Line 4: <input-output OS directory>
<log file>
The name of the file receiving the output log. When an existing log file is specified, the current CIM output is appended to the end of the existing log. The default value is the value of the mfguser variable. This has the format of TMP9999 where 9999 is a four-digit number that uniquely identifies the session. If the mfguser value is NULL (""), the log file is named mgsqmt03.
<log directory>
The location where the log file is stored. The blank value NULL ("") is specified as the default. When a <log directory> is not specified, the <log file> is placed in the PROPATH.
<sequence name>
Specifies the set of sequences to be maintained. You can specify a single sequence or the entire set. The default value is NULL (""), indicating all sequences will be maintained.
<action>
Specifies the activity to be performed, either (1) dumping or (2) loading.
Note: The default activity is dumping (1).
<input-output OS directory>
The directory in which the sequence files are maintained. The default value is the local directory.
A time stamp is issued to the log file at the beginning of each session. This permits the same log file to accumulate a history of the session logs. All log files have the .log suffix.
Example: The following is an example of a working CIM file:
@@batchload mgsqmt01.p
“sq_err.log” “/qad”
-
2
“/qad/backup”
@@end
This file outputs the error log to the directory /qad with the name sq_err.log. All sequences are maintained. The hyphen () indicates that the default value, in this case all sequences, is accepted. Number two (2) indicates that the sequences are loaded. The directory in which the sequence files are maintained is /qad/backup.
Note: Only sequences currently implemented in the database can be maintained using CIM.