Menu item 40: Export DB/2 file(s) (Part 3)
FIXED (Fixed Text options) | This parameter only appears if TOFMT(*FIXED) is selected and controls several aspects of fixed-length ASCII file creation from the database file. The value *DFT (default value) selects the defaults for all of the elements described below.
|
HTML (HTML Options) This parameter only applies if TOFMT(*HTML) is selected and controls several aspects of HTML file creation from the database file.
This parameter contains 9 elements:
The value *DFT (default value) selects the defaults for all of the elements described below.
Date Format This option controls the format in which date information in the database file will be presented in the stream file.
Please note: This only applies to actual date fields in the database file. Numerical and alphanumerical fields containing date information cannot be identified as dates by *DBEXPORT.
*DBF | The date format is determined by the date format specified for the date field in the database file (DDS DATFMT and DATSEP keywords). |
*EXCEL | The date will be converted into Excel format, i.e. a numerical value representing a day count. This format is ideal if the CSV file will be loaded by Excel or a similar application. Excel will recognize the data as a date and it can be edited and date functions can be used. |
*ISO | ISO format (YYYY-MM-DD) will be used. |
*EUR | European format (DD.MM.YYYY) will be used. |
*USA | USA format (MM/DD/YYYY) will be used. |
*JIS | Japanese Industrial Standard (YYYY-MM-DD) will be used. |
All other options specify a date format and a separator character which divides the year, month, and day portions of the date.
Format
*SYSVAL | The date format defined in system value QDATFMT will be used. |
*JOB | The date format defined in the job attributes will be used. |
*DMY | DDMMYY format |
*DMYY | DDMMYYYY format |
*MDYY | MMDDYYYY format |
*YYMD | YYYYMMDD format |
*CDMY | CDDMMYY format. The C indicates the century (0 = 20th, 1=21st). |
*CMDY | CMMDDYY format. The C indicates the century (0 = 20th, 1=21st) |
*CYMD | CYYMMDD format. The C indicates the century (0 = 20th, 1=21st) |
*JUL | YYDDD format |
*LONGJUL | YYYYDDD format |
Separator Character
*JOB | The date separator character defined by the job attributes will be used. |
*NONE | No date separator character will be used. |
*SLASH | A forward slash (oblique or solidus) / will be used. |
*HYPHEN | A hyphen (dash) - will be used. |
*PERIOD | A period (full stop) . will be used. |
*COMMA | A comma , will be used. |
*COLON | A colon : will be used. |
*BLANK | A blank will be used. |
separator_char | Enter the separator character to be used to separate day, month, and year portions of the date. |
Time Format This option determines the format in which time information in the database file is presented in the stream file.
*DBF | The time format is the time format of the time field of the database file (DDS TIMFMT and TIMSEP keywords). |
*EXCEL | The time will be converted into Excel format, i.e. a numerical value representing a number of seconds. This format is ideal if the CSV file will be loaded by Excel or a similar application. Excel will recognize the data as time and it can be edited and time functions can be used. |
*ISO | ISO format (HH.MM.SS) will be used. |
*EUR | European format (HH.MM.SS) will be used. |
*USA | USA format (HH:MM:SS) will be used. |
*JIS | Japanese Industrial Standard (HH:MM:SS) will be used. |
All other options specify a time format and a separator character which divides the hour, minute, and second portions of the time.
Please note:
This only applies to actual time fields in the database file. Numerical and alphanumerical fields containing times cannot be identified as times by *DBEXPORT.
Format
*HMS | HHMMSS format |
Separator Character
*SYSVAL | The time separator determined by system value QTIMFMT will be used. |
*JOB | The time separator character determined by the job attributes will be used. |
*NONE | No time separator character will be used. |
*PERIOD | A period (full stop) . will be used. |
*COMMA | A comma , will be used |
*COLON | A colon : will be used. |
*BLANK | A blank will be used. |
separator_char | Enter the separator character to be used to separate hour, minute, and seconds. |
Decimal Point Character This element determines the characters to be used to denote a decimal point when representing fields with one or more decimal places.
*SYSVAL | The decimal format determined by system value QDECFMT will be used. |
*JOB | The decimal format determined in the job attributes will be used. |
*PERIOD | A period (full stop). will be used. |
*COMMA | A comma , will be used. |
HTML Title Text input here will appear in the title bar of the browser when HTML file is displayed.
*NONE | The file has no title. |
Title_text | The title can have up to 128 characters. |
Table Caption Text input here will appear as the HTML table caption. The HTML table caption is a explanatory text displayed above a data table.
*NONE | The table has no caption. |
Caption_text | The caption can have up to 128 characters. |
Table's Boarder Width The width of the tables boarder in pixels.
1 | The table will have a boarder that is one pixel wide. |
width | The width in pixels (1-99) |
Table Cell Spacing This attribute specifies how much space (measured in pixels) the browser should leave between the left side of the table and the left-hand side of the left-most column, as well as between the top of the table and the top side of the first row, and so on for the right and bottom of the table. The attribute also specifies the amount of space to leave between cells.
1 | The cell spacing will be 1 pixel. |
spacing | The cell spacing in pixels (1-99) |
Table Cell Padding This attribute specifies the amount of pixels between the border of the cell and its contents.
1 | The space will be 1 pixel. |
padding | Specify the space's size in pixels.(1-99) |
Apply Edit Codes and Words This option determines if CVTDBF will use edit codes (EDTCDE) and edit words (EDTWRD) as defined by the DDS for formatting fields in the target file.
*NO | Edit codes and words will not be used. |
*YES | Edit codes and words will be used. |
Convert Null Fields to This attribute determines how null fields are converted.
*NBSP | A cell containing a single non-breaking space () is created. This is the preferred way to display null fields in a browser. |
*EMPTY | An empty cell is created. Empty cells are not correctly displayed by many browsers. In previous releases, null fields were handled this way. |
HEADER (Header Options) The HEADER (Header Row options) parameter specifies if and how a header row will be created in the stream file.
Please note: Header rows cannot be created for fixed-length ASCII files created with TOFMT(*FIXED) because the fixed-length nature of the columns in these types of files do not allow the creation of a header row.
It is common practice to include a single row at the beginning of the data that provides column labels for the data in CSV, Excel and HTML files.
This parameter contains 3 elements:
The first element determines the source of the headers contents. The following options are possible:
*AVAIL | For CSV, Excel and HTML files, a header row will be created, and *DBEXPORT will select the best available labels from the input file to create the header row. This selection of label text is performed according to the following criteria. If the fields in the input file have Column Headings (DDS COLHDG keyword), they will be used to generate the column headings. If the fields in the input file have field aliases (DDS ALIAS keyword), those will be used. If the fields in the input file have text descriptors (DDS TEXT keyword), those will be used. If not, the field names will be used. For fixed-length ASCII text files, no header row will be created |
*NONE | No header will be created. |
*COLHDG | For CSV, Excel and HTML files, a header row will be created from the field column headings (DDS COLHDG keyword). This option is invalid if TOFMT(*FIXED) has been specified. |
*ALIAS | For CSV, Excel and HTML files, a header row will be created from the field aliases (DDS ALIAS keyword). his option is invalid if TOFMT(*FIXED) has been specified. |
*TEXT | For CSV, Excel and HTML files, a header row is created from the field text descriptors (DDS TEXT keyword). This option is invalid if TOFMT(*FIXED) has been specified. |
*FLDNAM | For CSV, Excel and HTML files, a header row is created from the field names. This option is invalid if TOFMT(*FIXED) has been specified. |
The second element determines if the column width will be fixed.
The following options are possible:
*NO | Column width remains variable. |
*YES | Column width will be fixed. |
The third element determines if column headings in Excel contain linefeeds when the text of the column headings is derived from DDS column headings (COLHDG keyword).
Options are:
*NO | If the text of the column headings is derived from DDS column headings (COLHDG keyword), a newline/linefeed character is inserted between each element of the headings in order to ensure they line up as they would in Power Systems applications (e.g.Query and SQL). |
*YES | No newline/linefeed character is inserted between heading elements. |
Additional Header - Line 1 The first of up to three free-format heading lines that appear above the column headings.
*NONE | No free-format heading line. |
Character Value | Specify the free-format heading text. |
Additional Header - Line 2 The second of up to three free-format heading lines that appear above the column headings.
*NONE | No free-format heading line. |
Character Value | Specify the free-format heading text. |
Additional Header - Line 3 The third of up to three free-format heading lines that appear above the column headings.
*NONE | No free-format heading line. |
Character Value | Specify the free-format heading text. |
Headers on Sheets with Text Overflow Specifies if headers will be repeated on sheets with text overflow, when formatting with Excel. If the amount of converted data exceeds the maximum number of rows of an Excel worksheet, i-effect® creates an extra text overflow, to retain the extra information. This element controls the rendering of column headers at the top of overflow sheets.
*NO | Headers will not be repeated in overflow sheets. They appear only at the beginning of the first worksheet. |
*YES | Headers will be repeated on text overflow sheets and appear at the top of all worksheets that are created. |
SORT (Sorting Tasks) The SORT (Sort Specifications) parameter can change the order in which records re-trieved from the input source are presented in the output stream file. It sorts the records by one or more fields.
Up to 50 sort keys may be specified in the format explained below, or one of these two single values can be selected:
*FILE | The file keys are used to sort the records. If the file has no keys, arrival sequence is used. |
*NONE | Arrival sequence is used. The records will be presented in the sequence in which they physically appear in the file. |
Each sort key has two elements:
Key Field Name
Field_name | Enter the name of the field which is to be used as a sort key. |
Key Field Order
*ASCEND | Sort in ascending sequence. |
*DESCEND | Sort in descending sequence. |
Suppress Repetitions Repetitions will be replaced by null cells.
*NO | Repeated values are not suppressed. |
*YES | Repeated values are suppressed. |
QRYSLT (Query Selection)
*ALL | All records of the input source will be selected. |
‚Query_selection' | Specify an expression of up to 512 characters (in apostrophes), which describes the values used to select records. |
Any logical expression, either formed from relationships (such as *EQ and *NE) of field and constant values or functions of field and constant values, can be entered. At least one field name is specified in each relationship.
The syntax of this query selection string is identical to that used by the QRYSLT parameter's OPNQRYF command.
Please note: If the input to CVTDBF is one of the special values *SQL, *SQLSRC, *QMQRY, or *QRYDFN, any record selections made in the SQL or query will reduce the size of the temporary results file that CVTDBF will process as its input. The *DBEXPORT QRYSLT parameter then controls record selection to the temporary results file, if appropriate. For example, SQL can be used to query the order file and calculate order totals by customer with the GROUP BY function. The SQL's WHERE clauses can be used to select only customers in New York State. The temporary results file would contain totals for each customer. The *DBEXPORT QRYSLT parameter could then be used to select only those customers whose totals exceed a given threshold value.
DBFCCSID The DBFCCSID (Database File CCSID) parameter specifies the CCSID (Coded Character Set Identifier) which best describes the encoding of data in the database file if this information is not otherwise available to *DBEXPORT.
The following options are possible:
*DBF | The CCSID will be determined from the information available in the database file metadata (DDS) |
*JOB | The CCSID of the current job will be used. |
*SYSVAL | The value of the QCCSID system value will be used. |
*USER | The CCSID attribute of the user's profile running the command will be used. |
CCSID_Value | Enter a CCSID. |
STMFCODPAG (Stream File Code Page) The STMFCODPAG (Stream File Code Page) parameter determines the way in which i-effect® will convert data from the format in which it is stored on the Power Systems (typically EBCDIC) to an appropriate format in the stream file (typically ASCII).
The rules used to determine how Power Systems data is converted are complex, and depend on numerous factors including the file format of the new stream file (as specified by the TOFMT parameter).
In particular, PDF has its own rules regarding data encoding, which are followed in all instances. The value specified by the STMFCODPAG parameter will be ignored in relation to PDF creation and CVTSPL will convert the spooled file contents and all other data (such as the values specified on the TITLE or KEYWORDS parameters) to a format compatible with PDF.
The following special values are possible:
*WINDOWS | If appropriate, a suitable Windows ASCII encoding scheme will be selected. For example, when converting a spooled file to *TEXT on a US Power Systems (CCSID 37), code page 1252 (Windows Western ASCII encoding) is selected for the ASCII text, whereas on a Greek Power Systems (CCSID 875), code page 1253 (Windows Greek) is selected. |
*PCASCII | A synonym for *WINDOWS provided for the sake of compatibility with previous releases and consistency with IBM-supplied commands such to CPYTOSTMF. |
*STDASCII | If appropriate, a suitable ISO ASCII encoding scheme will be selected. For example, when converting a spooled file to *TEXT on a US Power Systems (CCSID 37), code page 819 (ISO 8859-1) is selected for the ASCII text, whereas on a Greek Power Systems (CCSID 875), code page 813 (ISO 8859-7) is selected. |
*IBMASCII | If appropriate, a suitable PC ASCII encoding scheme will be selected. For example, when converting a spooled file to *TEXT on a US Power Systems (CCSID 37), code page 437 (IBM PC ASCII) is selected for the ASCII text, whereas on a Greek Power Systems (CCSID 875), code page 869 (IBM PC Data Greek) is selected. |
*ISOASCII | If appropriate, a suitable ISO ASCII encoding scheme will be selected. For example, when converting a spooled file to *TEXT on a US Power Systems (CCSID 37), code page 819 (ISO 8859-1) is selected for the ASCII text, whereas on a Greek Power Systems (CCSID 875), code page 813 (ISO 8859-7) is selected. |
*UNICODE | If appropriate, the data will be converted to Unicode format. Please note: Unicode data produced by i-effect® is in Big endian format (i.e. the most significant byte is stored first, which is common with the System i, as opposed to the PC Little endian convention, which stores the least significant byte first). If opening a text file created by i-effect® when STMFCODPAG(*UNICODE) was specified with an application such as Windows NotePad, select the Unicode Big endian format option. |
*STMF | If the stream file already exists, and if appropriate, the code page of the existing stream file is used for data conversion purposes. |
Code Page Number | Enter a specific code page number. |
Example:
CVTSPL FILE(INVOICES)
TGTFMT(*TEXT)...
STMFCODPAG(1253)
The CVTSPL command is creating an ASCII text file from a Greek-language spooled file called INVOICES. Code page 1253, suitable for Greek-language data, will be used to convert the contents of the spooled file.
Common Windows code pages are shown in the table below. CVTSPL maps EBCDIC CCSIDs to Windows code pages in this manner. If the ECBDIC CCSID has no defined mapping, code page 1250 is used by default. If the characters in the spooled file do not appear correctly in the stream file created by CVTSPL, try to specify it with the help of the STMFCODPAG parameter.
Code Page 1250 | Windows Latin-2 | US, Canada, Netherlands, Portugal, Brazil, New Zealand, Australia, Iceland etc |
Code Page 1251 | Windows Cyrillic | Russia, Serbia, Bulgaria |
Code Page 1252 | Windows Latin-1 | UK, France, Italy, Germany, Austria, Benelux, Canada, Switzerland, Spain, Latin America, other European |
Code Page 1253 | Windows Greek | Greece |
Code Page 1254 | Windows Turkish | Turkey |
Code Page 1255 | Windows Hebrew | Israel |
Code Page 1256 | Windows Arabic | Arabic-speaking countries |
Code Page 1257 | Windows Baltic Rim | Denmark, Norway, Finland, Sweden, Estonia |
Example:
CVTSPL FILE(FACTURES)
STMFCODPAG(1252)
In the example above, the CVTSPL command is used to create an ASCII text file from a French-language spooled file called FACTURES. Windows code page 1252, suitable for French-language data, will be used to convert the contents of the spooled file.
UNICODE The UNICODE (Unicode Options) parameter determines various Unicode related options when specifying a Unicode encoding scheme with the STMFCODPAG parameter.
This parameter contains 2 elements:
Big endian or Little endian Because UCS2 coding requires 2 bytes to display each character, this option determines the order in which the bytes will appear.
*BIG | Big endian representation with the most significant byte first (Power Systems norm). |
*LITTLE | Little endian representation with the least significant byte first (PC norm). |
Include Unicode marker? This option determines if *DBEXPORT will mark the beginning of a text file telling the reading application if the byte order is big endian or little endian.
Applications such as Windows NotePad check for a marker at the start of the file (hex x'FEFF' or x'FFFE') and use it to identify if Unicode data is encoded in big endian or little endian format.
*TOFMT | The file will be marked if *FIXED was entered in the TOFMT parameter, but not if the option *CSV was selected. |
*YES | Both *FIXED and *CSV will be marked. |
*NO | *FIXED and *CSV will not be marked. |
DBFDATFMT(Database Date Format) This parameter defines the format in which dates in the numerical fields of the database file will be converted.
If a field in the database file being converted is:
- A packed decimal or zoned decimal
- 6, 7, or 8 digits in length
- Not containing any decimal places
- Or was edited with an edit code of ‚Y'
*CVTDBF will attempt to interpret the field as a date and convert it to a date in the output file. For this reason, *CVTDBF must know in which date format the data appears.
The following options are possible:
*NONE | *CVTDBF will not attempt to convert numeric fields that appear to be dates into dates. They will be converted as numbers. |
*YMD | *CVTDBF will assume the date is in YYMMDD format if the field is 6-7 digits long, and in YYYYMMDD format if the field is 8 digits long |
*DMY | *CVTDBF will assume the date is in DDMMYY format if the field is 6-7 digits long, and in DDMMYYYY format if the field is 8 digits long. |
*MDY | *CVTDBF will assume the date is in MMDDYY format if the field is 6-7 digits long, and in MMDDYYYY format if the field is 8 digits long . |
*CYMD | CYYMMDD format, where C is 0 for the 20th century and 1 for the 21st. |
*CDMY | CDDMMYY format, where C is 0 for the 20th century and 1 for the 21st. |
*CMDY | CMMDDYY format, where C is 0 for the 20th century and 1 for the 21st. |
AUT (Authority) Determines the rights for the creation of data stream files. If the data stream file already exists, this parameter has no effect and the existing file retains its current settings.
The creator of the stream file (i.e. the user who issued the CVTSPL command) will always have complete rights to the new data stream file. This parameter controls the rights for other users.
The following options are possible:
*R | Read only. |
*W | Write only. |
*X | Execute only. |
*RW | Read and write. |
*RX | Read and execute. |
*WX | Write and execute. |
*RWX | Read, write and execute (all). |
*NONE | No authority. |
The second element of this parameter defines the public authority for the work files required to create a PDF file.
CVTSPL requires three temporary work files to generate PDF output. These files are normally automatically deleted when the command is completed or if an error occurs.
The files are named #job_nbr, where job_nbr is the job number of the job by which the command was run.
The owner of the temporary file is always granted full authority. This parameter controls the authority given to other users. The default is *RWX (read, write and execute authority, i.e. full authority).
Please note: if a value other than *RWX is specified by this command, it is possible, in certain circumstances, that the file's creator will not have authorization to delete the file, and be unable to clear them after use.
The following options are possible:
*R | Read only. |
*W | Write only. |
*X | Execute only. |
*RW | Read and write. |
*RX | Read and execute. |
*WX | Write and execute. |
*RWX | Read, write and execute (all). |
*NONE | No authority. |
Inherit auth. from directory? The INHERITAUT (Inherit Authority) parameter controls if object authorities are inherited from the parent directory in which the stream file is created.
The following options are possible
*NO | Authorities are not inherited from the directory. |
*YES | Authorities are inherited from the directory. |
If the INHERITAUT is set to *NO, the object authorities (*OBJEXIST, *OBJMGT, *OBJALTER, and *OBJREF), assigned to the owner, primary group, and *PUBLIC with respect to the stream file being created, are copied from the owner, primary group, and public object authorities of the parent directory in which the stream file is created. This occurs even when the new file has a different owner than the parent directory. The new file does not have any private authorities or authorization list. It only has authorities for the owner, primary group, and public. The owner is assigned full data authorities and *PUBLIC is assigned the data authorities specified by the AUT parameter.
If the INHERITAUT is set to*YES, the object authorities (OBJEXIST, *OBJMGT, *OBJALTER, and *OBJREF), assigned to the owner, primary group, and *PUBLIC with respect to the stream file being created, are copied from the owner, primary group, and public object authorities of the parent directory in which the stream file is created. However, the private authorities (if any) and authorization list (if any) are also copied from the parent directory. If the new file has a different owner than the parent directory and the new file's owner has a private authority in the parent directory, that private authority is not copied from the parent directory. The authority for the owner of the new file is copied from the owner of the parent directory. The owner is assigned full data authorities and *PUBLIC is assigned the data authorities specified by the AUT parameter.