IMAGINE command: Difference between revisions
Nest syntax, example, and usage notes under SYNC/EXTRACT |
|||
| (7 intermediate revisions by the same user not shown) | |||
| Line 12: | Line 12: | ||
</dl> | </dl> | ||
== | ==IMAGINE SYNC and IMAGINE EXTRACT== | ||
<p class="syntax">IMAGINE SYNC | EXTRACT [ | <p class="syntax">IMAGINE SYNC | EXTRACT [ASYNC] [MAXERR e] [MAXPENDING m] [RECORDNUMBER r] [NOCOMMIT] [TICK t] | ||
</p> | </p> | ||
| Line 20: | Line 20: | ||
<li><var class="term">SYNC</var> indicates that data is to be extracted and the <var>Model 204</var> file and <var>Imagine</var> are to be kept in sync after the command.</li> | <li><var class="term">SYNC</var> indicates that data is to be extracted and the <var>Model 204</var> file and <var>Imagine</var> are to be kept in sync after the command.</li> | ||
<li><var class="term">EXTRACT</var> indicates that data is to be extracted but the <var>Model 204</var> file and <var>Imagine</var> are not to be kept in sync after the command.</li> | <li><var class="term">EXTRACT</var> indicates that data is to be extracted but the <var>Model 204</var> file and <var>Imagine</var> are not to be kept in sync after the command.</li> | ||
<li><var class="term">NOCOMMIT</var> indicates that the data is to be sent to Imagine and processed, but not committed. This provides a way of validating that a file can be loaded into <var>Imagine</var> without actually doing so.</li> | <li><var class="term">ASYNC</var> indicates that the actual extract is to be performed on a daemon. In this mode, the command returns immediately after some preliminary setup. The advantage of this mode is that it frees up the issuing thread for other commands. The disadvantage is that one must look elsewhere to determine when the request completed and whether or not it was successful.</li> | ||
<li><var class="term">MAXERR</var> indicates the maximum number of record data errors allowed before the extract is aborted. One might wish to set this to a high value for an extract intended to scan a file for data integrity errors. Because records are sent asynchronously in batches, it's quite possible for the actual number of errors to exceed the <var>MAXERROR</var> value. <var>MAXERROR</var> defaults to 50.</li> | |||
<li><var class="term">MAXPENDING</var> indicates the maximum number of uncommitted record sends to be allowed in the extract. Setting this to a low value could result in reduced transfer rates because of network latency. <var>MAXPENDING</var> defaults to 4095.</li> | |||
<li><var class="term">NOCOMMIT</var> indicates that the data is to be sent to Imagine and processed, but not committed. This provides a way of validating that a file can be loaded into <var>Imagine</var> without actually doing so. This option makes no sense for a SYNC extract, so is only allowed with <code>IMAGINE EXTRACT</code>.</li> | |||
<li><var class="term">RECORDNUMBER</var> indicates the record number of the single record to be sent to Imagine. This might be useful for problem diagnosis or resending fixed up records that failed on an initial extract. This option makes no sense for a SYNC extract so is only allowed with <code>IMAGINE EXTRACT</code>. Other options (except <var>NOCOMMIT</var>) are ignored if <var>RECORDNUMBER</var> is specified.</li> | |||
<li><var class="term">TICK</var> indicates the number of records between progress messages (M204.3073) to the journal. This parameter also sets the frequency of progress messages on <var>Imagine</var>. <var>TICK</var> defaults to 100000.</li> | <li><var class="term">TICK</var> indicates the number of records between progress messages (M204.3073) to the journal. This parameter also sets the frequency of progress messages on <var>Imagine</var>. <var>TICK</var> defaults to 100000.</li> | ||
</ul> | </ul> | ||
===Syntax notes=== | |||
<p> | |||
The IMAGINE command operates on the context file which is either the current file or one | |||
explicitly specified before the command as in: | |||
</p> | |||
<p class="code">IN FILE FOOBAR EXTRACT NOCOMMIT | |||
</p> | |||
===Example=== | |||
<p> | |||
To put file FOO into sync mode, one can do: | |||
</p> | |||
<p class="code">OPEN FILE FOO | |||
IMAGINE SYNC TICK 200000</p> | |||
The <var>TICK</var> keyword indicates that a M204.3073 message should be issued every 200,000 | |||
records. If one wishes to see these messages on the operator console, one can do: | |||
<p class="code">MSGCTL M204.3073 OPR | |||
</p> | |||
<p> | |||
Note that the actual extraction of records is done on a daemon thread created by the | |||
IMAGINE command so the thread that issued the IMAGINE command would return fairly | |||
quickly. Also note that this means that there is no terminal for M204.3073 (or other) | |||
messages issued during the extract to appear, so one needs to look in the journal | |||
for errors, should they occur. | |||
</p> | |||
===Usage notes=== | |||
<p> | |||
To obtain a consistent view of the file on <var>Imagine</var>, the IMAGINE command | |||
first quiesces the file; that is, ensures that no updating transactions that had | |||
updated the file are active. This will usually take less than a second, but a long | |||
running transaction that had updated the file could make this take quite a while. | |||
As such, it is recommended that the IMAGINE command be issued at a relatively quiet | |||
time in terms of file updates. | |||
</p> | |||
<p> | |||
Once the extraction process has begun, whether <var>SYNC</var>, <var>EXTRACT</var>, | |||
or <var>NOCOMMIT</var>, any other thread that wishes to update a record in the file | |||
being extracted, cannot update the record until it has been copied to <var>Imagine</var> and | |||
committed. If it has already been done at the time of the commit, no wait is required. | |||
However, if the record has not been copied to and committed to <var>Imagine</var> the | |||
thread would send a request to the extracting daemon to immediately send the record to | |||
<var>Imagine</var> (if not already sent) and then to wake the updating thread when that | |||
record is committed on <var>Imagine</var>. This can cause a slight delay in update | |||
processing so, again, the recommendation is for extracts to be done at relatively quiet | |||
times for a file. | |||
</p> | |||
<p> | |||
If a file is in SYNC mode, once a record has been sent to <var>Imagine</var>, any updates | |||
to the file are sent to <var>Imagine</var> (via a broker connection) and those updates | |||
must be committed for the transaction to succeed. That is, if some error occurs on | |||
<var>Imagine</var> for a SYNC update, the request would be cancelled and the transaction | |||
backed out. Note that this processing occurs even after the file has been fully extracted, | |||
and the extracting daemon is no longer active. This ensures that the SYNC'ed file will | |||
remain consistent between <var>Model 204</var> and <var>Imagine</var> making it feasible | |||
to switch the file to transparency mode with a minimal outage. | |||
</p> | |||
<p> | |||
For a plain EXTRACT (as opposed to SYNC), updates to records in the file after they have | |||
committed in <var>Imagine</var> are not sent to <var>Imagine</var>, so the file can | |||
get out of synch between <var>Model 204</var> and <var>Imagine</var>. However, by not | |||
allowing any records to be updated in the file during the EXTRACT process until they | |||
have been committed on <var>Imagine</var>, the file on <var>Imagine</var> will be ensured | |||
to be a consistent view of the file as of the point in the <code>IMAGINE EXTRACT</code> | |||
command where updates to the file had been quiesced. | |||
</p> | |||
==IMAGINE ENDSYNC== | |||
<p class="syntax">IMAGINE ENDSYNC | <p class="syntax">IMAGINE ENDSYNC | ||
</p> | </p> | ||
This format indicates that a SYNC or EXTRACT for the file should be terminated. | |||
=== | ==IMAGINE LISTSYNC== | ||
<p class="syntax">IMAGINE LISTSYNC | |||
</p> | |||
This format lists the files currently in SYNC mode. For each such file, a row is | |||
printed with the following columns: | |||
<ul> | |||
<li><var class="term">FILE</var> — the <var>Model 204</var> file name.</li> | |||
<li><var class="term">SFX</var> — the broker suffix being used for the file's sync | |||
traffic (the value supplied via <var>APSYSUFFIX</var> when the file was put into | |||
sync mode), or <code>-</code> if no suffix is in use.</li> | |||
<li><var class="term">START</var> — the time at which the <code>IMAGINE SYNC</code> | |||
command was issued for the file, formatted as <code>YYYYMMDDHHMISS</code>.</li> | |||
<li><var class="term">END</var> — the time at which the extract phase completed, | |||
formatted as <code>YYYYMMDDHHMISS</code>. Blank if the extract is still running.</li> | |||
<li><var class="term">UPDATES</var> — the number of post-extract sync updates that | |||
have been sent to <var>Imagine</var> for the file. The counter is zeroed when the | |||
extract phase completes, so this value reflects only ongoing sync traffic, not the | |||
records sent during the initial extract.</li> | |||
</ul> | |||
<var>IMAGINE LISTSYNC</var> takes no parameters and is independent of the current | |||
context file. | |||
==See also== | ==See also== | ||
<ul> | |||
<li>[[Imagine Transparency]]</li> | |||
</ul> | |||
[[Category: File manager commands]] | [[Category: File manager commands]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
Latest revision as of 21:29, 4 June 2026
Move Model 204 data to Imagine
This command provides the facilities to extract Model 204 data and load it into Imagine.
Summary
- Privileges
- File manager
- Function
- provides the facilities to extract Model 204 data and load it into Imagine.
IMAGINE SYNC and IMAGINE EXTRACT
IMAGINE SYNC | EXTRACT [ASYNC] [MAXERR e] [MAXPENDING m] [RECORDNUMBER r] [NOCOMMIT] [TICK t]
Where:
- SYNC indicates that data is to be extracted and the Model 204 file and Imagine are to be kept in sync after the command.
- EXTRACT indicates that data is to be extracted but the Model 204 file and Imagine are not to be kept in sync after the command.
- ASYNC indicates that the actual extract is to be performed on a daemon. In this mode, the command returns immediately after some preliminary setup. The advantage of this mode is that it frees up the issuing thread for other commands. The disadvantage is that one must look elsewhere to determine when the request completed and whether or not it was successful.
- MAXERR indicates the maximum number of record data errors allowed before the extract is aborted. One might wish to set this to a high value for an extract intended to scan a file for data integrity errors. Because records are sent asynchronously in batches, it's quite possible for the actual number of errors to exceed the MAXERROR value. MAXERROR defaults to 50.
- MAXPENDING indicates the maximum number of uncommitted record sends to be allowed in the extract. Setting this to a low value could result in reduced transfer rates because of network latency. MAXPENDING defaults to 4095.
- NOCOMMIT indicates that the data is to be sent to Imagine and processed, but not committed. This provides a way of validating that a file can be loaded into Imagine without actually doing so. This option makes no sense for a SYNC extract, so is only allowed with
IMAGINE EXTRACT. - RECORDNUMBER indicates the record number of the single record to be sent to Imagine. This might be useful for problem diagnosis or resending fixed up records that failed on an initial extract. This option makes no sense for a SYNC extract so is only allowed with
IMAGINE EXTRACT. Other options (except NOCOMMIT) are ignored if RECORDNUMBER is specified. - TICK indicates the number of records between progress messages (M204.3073) to the journal. This parameter also sets the frequency of progress messages on Imagine. TICK defaults to 100000.
Syntax notes
The IMAGINE command operates on the context file which is either the current file or one explicitly specified before the command as in:
IN FILE FOOBAR EXTRACT NOCOMMIT
Example
To put file FOO into sync mode, one can do:
OPEN FILE FOO IMAGINE SYNC TICK 200000
The TICK keyword indicates that a M204.3073 message should be issued every 200,000 records. If one wishes to see these messages on the operator console, one can do:
MSGCTL M204.3073 OPR
Note that the actual extraction of records is done on a daemon thread created by the IMAGINE command so the thread that issued the IMAGINE command would return fairly quickly. Also note that this means that there is no terminal for M204.3073 (or other) messages issued during the extract to appear, so one needs to look in the journal for errors, should they occur.
Usage notes
To obtain a consistent view of the file on Imagine, the IMAGINE command first quiesces the file; that is, ensures that no updating transactions that had updated the file are active. This will usually take less than a second, but a long running transaction that had updated the file could make this take quite a while. As such, it is recommended that the IMAGINE command be issued at a relatively quiet time in terms of file updates.
Once the extraction process has begun, whether SYNC, EXTRACT, or NOCOMMIT, any other thread that wishes to update a record in the file being extracted, cannot update the record until it has been copied to Imagine and committed. If it has already been done at the time of the commit, no wait is required. However, if the record has not been copied to and committed to Imagine the thread would send a request to the extracting daemon to immediately send the record to Imagine (if not already sent) and then to wake the updating thread when that record is committed on Imagine. This can cause a slight delay in update processing so, again, the recommendation is for extracts to be done at relatively quiet times for a file.
If a file is in SYNC mode, once a record has been sent to Imagine, any updates to the file are sent to Imagine (via a broker connection) and those updates must be committed for the transaction to succeed. That is, if some error occurs on Imagine for a SYNC update, the request would be cancelled and the transaction backed out. Note that this processing occurs even after the file has been fully extracted, and the extracting daemon is no longer active. This ensures that the SYNC'ed file will remain consistent between Model 204 and Imagine making it feasible to switch the file to transparency mode with a minimal outage.
For a plain EXTRACT (as opposed to SYNC), updates to records in the file after they have
committed in Imagine are not sent to Imagine, so the file can
get out of synch between Model 204 and Imagine. However, by not
allowing any records to be updated in the file during the EXTRACT process until they
have been committed on Imagine, the file on Imagine will be ensured
to be a consistent view of the file as of the point in the IMAGINE EXTRACT
command where updates to the file had been quiesced.
IMAGINE ENDSYNC
IMAGINE ENDSYNC
This format indicates that a SYNC or EXTRACT for the file should be terminated.
IMAGINE LISTSYNC
IMAGINE LISTSYNC
This format lists the files currently in SYNC mode. For each such file, a row is printed with the following columns:
- FILE — the Model 204 file name.
- SFX — the broker suffix being used for the file's sync
traffic (the value supplied via APSYSUFFIX when the file was put into
sync mode), or
-if no suffix is in use. - START — the time at which the
IMAGINE SYNCcommand was issued for the file, formatted asYYYYMMDDHHMISS. - END — the time at which the extract phase completed,
formatted as
YYYYMMDDHHMISS. Blank if the extract is still running. - UPDATES — the number of post-extract sync updates that have been sent to Imagine for the file. The counter is zeroed when the extract phase completes, so this value reflects only ongoing sync traffic, not the records sent during the initial extract.
IMAGINE LISTSYNC takes no parameters and is independent of the current context file.