Home | Previous Page | Next Page   The onpladm Utility > Defining Maps >

Creating Maps

You can create maps by using a quick command or a specification file. For more information on specification-file conventions, see Specification-File Conventions.

Creating a Map by Using a Quick Command

When you create a map by using a quick command, the onpladm utility creates a format object with the same name as the map, plus the suffix -fmt. The generated format name (as for all onpladm objects) has a maximum length of 18 characters.

For example, if the map name is mymap, the format name is mymap-fmt. If the map name is 123456789123456789, the format name is 12345678912345-fmt.

The create map command also creates a query object for the unload map. The following diagram illustrates the syntax to create a map from the command line.

Read syntax diagramSkip visual syntax diagramCreating a Map
 
>>-onpladm create map--mapname--+--------------+---------------->
                                '- -p--project-'
 
>-- -D--database-- -t--table------------------------------------>
 
   .-----------------------------------------.
   V                                         |
>----+-------------------------------------+-+-----------------><
     +- -S--servername---------------------+
     +- -T--targetservername---------------+
     +-| Setting the 

Format |-+ '- -f--+---+--------------------------' +-l-+ '-u-'

Element Purpose Key Considerations
-D database Name of the target database that contains the information to be loaded or unloaded Additional Information: No default value
-f Flags to specify the type of job Additional Information: The default is load job.
l Specifies a load job None
u Specifies an unload job None
mapname Sets the map None
-p project Identifies the project where the format and map are stored Additional Information: The default is the project created when the onpload database is built.
-S server Sets the onpload database server Additional Information: The default is the value of the INFORMIXSERVER environment variable.
-t table Name of the table to be loaded or unloaded None
-T target Name of the target server to which the data will download Additional Information: The default is the value of the INFORMIXSERVER environment variable.

The following diagram illustrates the syntax to set the format type with the -z option.

Read syntax diagramSkip visual syntax diagramSetting the Format:
 
|-- -z--+----+--------------------------------------------------|
        +-D--+
        +-FI-+
        +-FA-+
        +-FB-+
        +-C--+
        '-CB-'
 

Element Purpose Key Considerations
D Sets the format to delimited Additional Information: This is the default value. See Delimited Records.
FI Sets the format to fixed internal Additional Information: See Fixed-Length Records.
FA Sets the format to fixed ASCII Additional Information: See Fixed-Length Records.
FB Sets the format to fixed binary Additional Information: See Fixed-Length Records.
C Sets the format to COBOL Additional Information: See COBOL Records.
CB Sets the format to COBOL (byte) Additional Information: See COBOL Records.

Creating a Map With a Detailed Specification File

When you create a map, the onpladm utility creates a format object with the same name as the map.

When you create a map with a specification file, you must create all associated HPL objects; the onpladm utility does not create these objects for you.

Use the syntax shown in Specification-File Conventions to create maps with specification files.

Use the following syntax to creating a load map with a specification file:

BEGIN OBJECT LOADMAP mapname 

# Compulsory Attributes 
PROJECT projectname 
FORMAT formatname 
DATABASE targetdatabasename 
TABLE targettablename 

BEGIN SEQUENCE 
COLUMNNAME columnname 
FIELDNAME fieldname 
JUSTIFICATION justification 
CASECONVERT caseconversion 
DEFAULTVALUE defaultvalue 
TRANSFERBYTES byte_transfer 
COLUMNOFFSET column_offset 
FIELDOFFSET field_offset 
FIELDMINIMUM field_minimum 
FIELDMAXIMUM field_maximum 
FILLCHARACTER fillcharacter 
PICTURE picture 
FUNCTION record_function 
STORAGECODING storage_format
BLOBCOLUMN blob_columnname
END SEQUENCE 

END OBJECT  

The following table lists the attributes and their values.

Attribute Attribute Value
blob_columnname The column that contains the name of the file where BYTE or TEXT data is stored
See Simple LO Data in a Separate File.
byte_transfer Number of bytes to transfer from record field to database column
caseconversion Enter UPPER for all uppercase data, LOWER for all lowercase data, and PROPER for data with an initial capital letter
columnname Name of the column to be mapped
column_offset Amount of offset from the beginning of the column to the location on the column from which data transfer begins
defaultvalue Value when no field is mapped to the column
fieldname Field corresponding to the record format to be mapped
field_maximum Largest acceptable numeric-column value
field_minimum Smallest acceptable numeric-column value
field_offset Amount of offset from the start of the field record to the location in the record from which data transfer begins
fillcharacter Character used to pad contents of a field
formatname Associated format name

You must create the format; onpladm does not create it for you.

justification Enter LEFT, RIGHT, or CENTER to position text within a record
mapname Map name
picture Reformats and masks data from the field of a record before data is transferred to database
projectname Name of existing project
record_function User-defined function in a shared library that is called for every record that is processed

See Appendix E. Custom-Conversion Functions.

storage_format The format in which to store BYTE or TEXT data
targetdatabasename Name of the database that the records will be loaded and unloaded to
targettablename Target-table name

Use the following syntax to create an unload map with a specification file:

BEGIN OBJECT UNLOADMAP mapname 

# Compulsory Attributes 
PROJECT projectname 
FORMAT formatname 
DATABASE targetdatabasename 
QUERY queryname 

BEGIN SEQUENCE 
COLUMNNAME columnname 
FIELDNAME fieldname 
JUSTIFICATION justification 
CASECONVERT caseconversion 
DEFAULTVALUE defaultvalue 
TRANSFERBYTES byte_transfer 
COLUMNOFFSET column_offset 
FIELDOFFSET field_offset 
FIELDMINIMUM field_minimum 
FIELDMAXIMUM field_maximum 
FILLCHARACTER fillcharacter 
PICTURE picture 
FUNCTION record_function 
STORAGECODING storage_format
BLOBCOLUMN blob_columnname
END SEQUENCE 

END OBJECT  

The following table lists the attributes and their values.

Attribute Attribute Value
blob_columnname The column that contains the name of the file where BYTE or TEXT data is stored

See Simple LO Data in a Separate File.

byte_transfer Number of bytes to transfer from record field to database column
caseconversion Enter UPPER for all uppercase data, LOWER for all lowercase data, and PROPER for data with an initial capital letter
columnname Name of the column to be mapped
column_offset Amount of offset from the beginning of the column to the location on the column from which data transfer begins
defaultvalue Value when no field is mapped to the column
fieldname Field corresponding to the record format to be mapped
field_maximum Largest acceptable numeric-column value
field_minimum Smallest acceptable numeric-column value
field_offset Amount of offset from the start of the field record to the location in the record from which data transfer begins
fillcharacter Character used to pad contents of a field
formatname Associated format name
justification Enter LEFT, RIGHT, or CENTER to position text within a record
mapname Map name
picture Reformats and masks data from the field of a record before data is transferred to database
projectname Name of existing project
queryname Query name
record_function User-defined function in dynamically linked library that is called for every record that is processed

See Appendix E. Custom-Conversion Functions.

storage_format The format in which to store BYTE or TEXT data
targetdatabasename Name of the database that the records will be loaded and unloaded to
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]