You can create a dynamic entity using a COBOL flat file that has a companion COBOL copybook (schema).
Before you issue the createentity
command, create a loader connection
for the COBOL data source. The loader connection specifies where the data source files
are located and allows the createentity
command to connect to the data
source and initiate the entity creation process. (For information about creating a
loader connection, see Loader
Connections).
Copybook and data file directories do not need to be specified when they are referenced within the loader connection set up by the repository administrator.
Syntax
createentity <loader_connection> datafile <filename> schemafile <copybook_filename>
where,
<loader_connection> |
Name assigned by the repository administrator to the loader connection. |
<filename> |
Name of the COBOL flat file that contains the data. |
<copybook_filename> |
Name of the schema file that corresponds to the COBOL flat file you specified as the data file. |
Optional Parameters
Parameter |
Description |
---|---|
username <user_name> |
User ID required to validate the connection to the data source. Use this parameter only if a login name and password are required. Do not use the |
password <password> |
Password required to validate the connection to the data source. Use this parameter only if a login name and password are required. |
jobname <job_name> |
Job ID or name of the data load job. |
charset <value> |
Indicates the character encoding used by the COBOL data and
copybook files; the options are |
endian <value> |
Indicates the byte order. The options are
|
packed <value> |
Indicates the structure of the data. Set to |
align <value> |
Indicates one- or two-byte data alignment. The options are
|
redefines <value> |
Indicates how to manage REDEFINES clauses in a copybook. The
options are Type Type |
terminator <value> |
Indicates how records in the data file are terminated. The
options are Typically, COBOL data files are fixed length and have no record delimiter. However, if COBOL data is exported from the original application and transferred into other file systems (especially UNIX), they could contain record delimiters added by the export or transfer process. If the file originated from: Windows, type UNIX, type IBM mainframe, type |
encoding <value> |
Indicates the character encoding used by the data file. The
options are EBCDIC data is translated into a correct ASCII representation on load. Generally, UNIX COBOL files will be ASCII and IBM mainframe data will be EBCDIC. |
ational <value> |
National character encoding used by the data file. If your COBOL copybooks define national data items holding Unicode strings (such as PIC clause containing N and USAGE NATIONAL) or your compiler options from the data source are set to NSYMBOL (NATIONAL) or CODEPAGE, you should specify the National Character encoding standard of the data source. |
columns <names> |
Indicates the names of the columns from which to import data. |
skip <number> |
The number of rows to skip before starting to import data rows. All rows after the skipped rows will be loaded to the repository. For example, if your file has 300 rows and you select to skip the first 99, the system will load 200 rows, starting with the 100th row. |
first <number> |
Number of records from the beginning of the file to load (for example, the first 1000 records). |
random <percentage> |
Indicates the degree to which you want to randomly sample a percentage of records from the file. |
Example
This command uses a loader connection named cobolconn
, provides a
username and password to access the data directories, and then loads data from three
columns in the testcp932.dat data file.
createentity cobolconn username radmin password serverheaven encoding cp932 datafile q34fin95.dat schemafile q34fin95.cpy columns {{Ref Id} Source Amount}
When multiple columns are represented within a space-delimited line of column names, be sure to enclose them in braces ({}). If a column name contains whitespace, enclose the column name in braces ({}) also.