Print Page as PDF
Extract Tool API ICR (10151)

Extract Tool API    ICR (10151)

Name Value
NUMBER 10151
IA # 10151
DATE CREATED 1994/06/24
CUSTODIAL PACKAGE VA FILEMAN
CUSTODIAL ISC San Francisco
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE DIAXU
NAME Extract Tool API
ORIGINAL NUMBER 10151
GENERAL DESCRIPTION
The Extract Tool lets you move or copy records from one
VA FileMan file to another; a typical use is to archive records.
STATUS Active
ID DIAXU
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
EN
This entry point extracts data specified in the
extract template for a single entry, and moves that data to a destination
file.
VARIABLES TYPE VARIABLES DESCRIPTION
DIAXF Both
Input: (Required) The number of the file that
contains the source entry.

Output: Not killed upon exit.
DIAXT Both
Input: (Required) The extract template name enclosed
in brackets in the source file that contains specifications of data to be
extracted.

Output: Not killed upon exit.
DIAXDEL Both
Input: (Optional) This variable, if defined, tells
the program to delete the source entry. If not defined, the source entry is
unchanged.

Output: Not killed upon exit.
DIAXDA Output
Internal entry number of entry created in the
destination file. In addition to DIAXDA,

^TMP("DIAXU",$J,"RESULT",DIAXF,DIAXFE)=DIAXDA is returned.
DIAXNTC Output
No longer returned. For batch processing of extracts,
you should use the EXTRACT^DIAXU entry point instead of this one.
DIAXFE Both
Input: (Required) Internal entry number of the source
entry from which data will be extracted.

Output: Not killed upon exit.
DIERR Output
Contains the following two ^-pieces of information:

Number of errors generated during the call Total number of lines of the error
messages

In addition, the following "RESULT","ERR" node is returned:

^TMP("DIAXU",$J,"RESULT","ERR",file#,ien)
TMP("DIERR",$J,... Output
Errors information is returned in ^TMP("DIERR",$J),
in the same format error information is returned for DBS calls.
EXTRACT()
Entry point for extracting data are:

More than one record can be extracted in a call. Subrecords can be extracted
as individual transactions. Previously, an entire record including all
subrecords had to be extracted as a single entity. DBS-style error reporting
is used.

Format D EXTRACT^DIAXU(FILE,SOURCE,EXTRACT_TEMPLATE,FLAGS,.SCREENS,
.FILING_LEVEL,TARGET_ROOT,MSG_ROOT)
VARIABLES TYPE VARIABLES DESCRIPTION
FILE Input
(Required) File number of source file.
SOURCE Input
(Required) Can be 1 of 2 formats: IEN: The record
number of a single record, at the top level of the file, to extract. Search
template name: The name of a search template, in brackets, that contains
SEARCH results (a list of record numbers). For example, S
SOURCE="[TEMPLATE_NAME]"
EXTRACT_TEMPLATE Input
(Required) The name of the Extract Template, in
brackets, containing what fields to move.
FLAGS Input
(Optional) A string of characters to modify the
behavior of the Extract tool. Permissible characters in the string are: D
Tells the extract tool to delete source records if they were moved
successfully. Note that deletion is only done for entire (top-level) records.
Subrecords are not individually deleted, even if they are individually
extracted.
.SCREENS Input
(Optional) Local array containing screen(s) to apply
to subrecords at various subrecord levels. The screens determine whether to
move individual subrecords at a given level or not.
.FILING_LEVEL Input
(Optional) Local array you can use to tell the
Extract tool to file subrecords as individual transactions, at one or more
subfile levels. The default filing mode is to file an entire record, including
all subrecords, as a single transaction.
TARGET_ROOT Both
Input: (Optional) Array that should receive the
results generated during the extract tool process. This must be a closed array
reference and can be either local or global.  If you do not pass this
parameter, the results are returned in ^TMP("DIAXU",$J).

Output: One "RESULT" node is returned for each record extracted (or attempted
to be extracted).
MSG_ROOT Both
Input: (Optional) Array that should receive error
messages generated during the extract tool process. This must be a closed
array reference and can be either local or global.  If you do not pass this
parameter, error messages are returned in ^TMP("DIERR",$J).

Output: Error messages are returned in MSG_ROOT("DIERR") (if the MSG_ROOT
input parameter is passed) or ^TMP("DIERR",$J) (if no array is specified).
Errors are returned in DBS-style format.
DIERR Output
This variable is returned if an error condition
occurred. It contains two ^-pieces of information: Number of errors generated
during the call Total number of lines of the error messages Associated error
messages are stored, DBS-style, in MSG_ROOT.