Create Table (CRTTBL)

The Create Table (CRTTBL) command creates a named table. The table can be used for the translation of data that is moved between the system and a device. The table can also be used to specify an alternate collating sequence or to specify field translation functions.

You can create a table by prompting for the source information, or by specifying a source member.

To create a table using prompting support, specify *PROMPT on the SRCFILE parameter. A display is shown allowing you to view and change the table values and a new table is created based on the values chosen on the display.

To create a *CVT table using a source member, you must specify a source member that contains 8 records. Each record in this member must contain 64 hexadecimal characters (characters after position 64 are not used). This input (512 hexadecimal characters) is converted and stored internally as 256 bytes by the CRTTBL command.

The value you specify for a position within the source member is the same value that is returned by QDCXLATE (or other system program) whenever that position is encountered.

For example, if you specify "C0C1C2C3C4C5C6...'' as the first part of record 1 in the source, then a hexadecimal "C0" is returned when given a hexadecimal "00", a hexadecimal "C1" is returned when given a hexadecimal "01" and so on.

To create a *UCSSRTSEQ table using a source member, you must specify a source member that contains the following layout of information.

  1. column 1-4 = Hex code point to be sorted
  2. column 6-10 = Weight of this code point as a decimal number
  3. column 11-80 = not used, can contain such things as comments.

Parameters

Keyword Description Choices Notes
TBL Table Qualified object name Required, Positional 1
Qualifier 1: Table Name
Qualifier 2: Library Name, *CURLIB
SRCFILE Source file Single values: *PROMPT
Other values: Qualified object name
Optional, Positional 2
Qualifier 1: Source file Name, QTBLSRC
Qualifier 2: Library Name, *LIBL, *CURLIB
SRCMBR Source member Name, *TBL Optional, Positional 3
TBLTYPE Table type *CVT, *SRTSEQ, *UCSSRTSEQ Optional
BASETBL Basing table Single values: *HEX
Other values: Qualified object name
Optional
Qualifier 1: Basing table Name
Qualifier 2: Library Name, *LIBL, *CURLIB
BASESRTSEQ Basing sort sequence Single values: *LANGIDSHR, *HEX, *JOB, *LANGIDUNQ
Other values: Qualified object name
Optional
Qualifier 1: Basing sort sequence Name
Qualifier 2: Library Name, *LIBL, *CURLIB
BASELANGID Basing language ID Character value, *JOB Optional
CCSID Coded character set ID 1-65533, *JOB, *HEX, 65535 Optional
TEXT Text 'description' Character value, *BLANK Optional
AUT Authority Name, *LIBCRTAUT, *CHANGE, *ALL, *USE, *EXCLUDE Optional

Table (TBL)

Specifies the library name and table name of the table being created.

This is a required parameter.

The possible library values are:

*CURLIB
The library for the job is used to locate the table. If no library is specified as the library for the job, QGPL is used.
name
Specify the name of the library to be searched.

The possible values are:

table-name
Specify the name of the table being created.

Source file (SRCFILE)

Specifies the qualified name of the source file containing the description of the table being created or that prompting support is to be used.

The possible values are:

*PROMPT
Allows the user to access and use source information.
QTBLSRC
The system source file named QTBLSRC contains the source records that are used with this command to create the table.
source-file-name
Specify the name (library-name/source-file-name) of the source file that contains the source records that are used with this command to create the table.

The possible library values are:

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the source file. If no current library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library to be searched.

Source member (SRCMBR)

Specifies the name of the source file member containing the description of the table being created.

The possible values are:

*TBL
The source file member name is the same as the name of the table.
source-file-member-name
Specify the name of the member in the source file specified on the Source file prompt (SRCFILE parameter) to create the table.

generic*-table-name Specify the generic name of the table. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. If a generic name is specified, then all tables with names that begin with the generic name, and for which the user has authority, are shown. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete table name.

Table type (TBLTYPE)

Specifies the type of table object to be created.

The possible values are:

*CVT
A conversion type table is created.
*SRTSEQ
A sort sequence type table is created.
*UCSSRTSEQ
An IS0-10646 UCS-2 sort sequence type table is created.

Basing table (BASETBL)

Specifies the base table to be used for prompting support when creating a conversion table.

The possible values are:

*HEX
A one to one mapping table is used.

The name of the table can be qualified by one of the following library values:

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name
Specify the name of the library to be searched.
table-name
Specify a table object to be used as a base.

Basing sort sequence (BASESRTSEQ)

Specifies the base table to be used for prompting support when creating a sort sequence table.

The possible values are:

*JOB
The sort sequence must be resolved when the object is created.
*LANGIDSHR
A shared weight sort table is used.
*LANGIDUNQ
A unique weight sort table is used.
*HEX
A sort sequence table is not used. The hexadecimal values of the characters are used to determine the sort sequence. The CCSID for hexadecimal data is 65535.

The name of the table can be qualified by one of the following library values:

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
library-name
Specify the name of the library to be searched.
table-name
Specify the name of a table object to be used as a base.

Basing language ID (BASELANGID)

Specifies the base language used for prompting support when creating a sort sequence table.

The possible values are:

*JOB
The sort sequence must be resolved when the object is created.
language-ID
Specify a valid language ID to be used for the sort sequence table being created.

Coded character set ID (CCSID)

Specifies the coded character set ID (CCSID) in which to store the sort sequence table information.

The possible values are:

*JOB
The sort sequence must be resolved when the object is created.
coded-character-set-ID
Specify the CCSID to be used for the sort sequence table information.

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

The possible values are:

*BLANK
No text is specified.
character-value
Specify no more than 50 characters of text, enclosed in apostrophes.

Authority (AUT)

Specifies the authority you are giving to users who do not have specific authority for the object, who are not on an authorization list, and whose group profile or supplemental group profiles do not have specific authority for the object.

*LIBCRTAUT
The authority for the object is the same as the value specified on the Create authority prompt (CRTAUT parameter) of the library in which the object is being created. If the value specified on the Create authority prompt (CRTAUT parameter) is changed, the new value will not affect any existing objects.
*CHANGE
The user can perform all operations on the object except those limited to the owner or controlled by object existence (*OBJEXIST) and object management (*OBJMGT) authorities. The user can change and perform basic functions on the object. *CHANGE authority provides object operational (*OBJOPR) authority and all data authority. If the object is an authorization list, the user cannot add, change, or remove users.
*ALL
The user can perform all operations except those limited to the owner or controlled by authorization list management (*AUTLMGT) authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the object.
*USE
The user can perform basic operations on the object, such as running a program or reading a file. The user cannot change the object. Use (*USE) authority provides object operational (*OBJOPR), read (*READ), and execute (*EXECUTE) authorities.
*EXCLUDE
The user cannot access the object.
authorization-list-name
Specify the name of an authorization list to be used for authority to the object. Users included in the authorization list are granted authority to the object as specified in the list. The authorization list must exist when the object is created.

Examples

CRTTBL   TBL(SCRAMTBL)  SRCFILE(USERTABLES)  SRCMBR(SCRAMBLE)
         TEXT('Translate table for scrambling text characters')

This command creates a table named SCRAMTBL and (by default) stores it in the current library. The source file named USERTABLES contains the source records used when the table is created; the name of the source file member is SCRAMBLE. The TEXT parameter describes this table as being used as a translate table for scrambling text characters.

Error messages

*ESCAPE Messages

CPF2207
Not authorized to use object &1 in library &3 type *&2.
CPF2614
Table &1 in &2 already exists.
CPF2623
Library &1 not found.
CPF2678
Data in source file &1 in &2 not valid.
CPF3BF7
Data in source file at line &1 is not correct
CPF3FC9
Value &1 for CCSID not valid.
CPF9820
Not authorized to use library &1.