Date Command [DA]
Specify a specific date-format for all dates.
INVALID ASTERISKS | NULL | "string"
DATE NONE | date-format [ "separator" ]
INVALID ASTERISKS | NULL | "string"
(Default: yyyymmdd Invalid Asterisks)
Use the Date command to specify an output format for dates. Use the Invalid option to specify how invalid dates should be formatted in the output file. The advantage of the None option is that it formats all dates, whether they are valid or not. If you select a date-format, the default Invalid option replaces invalid dates with asterisks
"*".
STExport must know which fields are dates and the format of each date. Use
Suprtool's Item command and Output,Link option to specify the date information.
Date Format
The date-format can be one of:
• ccyymmdd
• yyyymmdd
• ddmmyyyy
• mmddyyyy
• yymmdd
• ddmmyy
• mmddyy
• aammdd
STExport converts each date field from its internal date format into the format that you specify.
Separator Character
By default, STExport formats all dates without a separator between the day, month, and year. Specify your own separator by enclosing it inside quotes after you specify the date format. The separator must be one character long. For example, to specify dates in ddmmyyyy format with a slash separator, use
$date ddmmyyyy "/"
To specify dates in yymmdd format with a dash separator, use
$date yymmdd "-"
Oracle Dates
Oracle dates contain both the date and the time. STExport formats the date, but not the time. If you specify Date None, Oracle dates will be treated as byte-type fields.
202
• STExport Commands
Suprtool 4.6.01 for HP-UX User Manual
Since Oracle dates actually contain binary data, the output is often unusable by other applications, unless you specify a specific date-format.
Invalid Dates
By default, all invalid dates are formatted as asterisks. STExport treats any date that does not have a valid century, year, month, or combination (e.g., February 29, 2000) as invalid. You can specify how you want STExport to format invalid dates by using the Invalid option of the Date command.
If you specify,
$date invalid null
STExport will produce a zero-length field if you specify Column Variable and spaces if you specify Column Fixed. If you want to specify an explicit string for all invalid dates, do so after the Invalid option. For example,
$date invalid "%%%%%" will cause STExport to produce a string of five percent signs for any invalid date.
Example
First, use Suprtool to create the input file with the appropriate date attributes:
>get d-sales
>item deliv-date,date,mmddyyyy
>item purch-date,date,mmddyyyy
>output dsales,link
>xeq
Then use STExport to read the dsales file. Specify Date ddmmyyyy "-" which causes all valid dates to be formatted in day-month-year format with a dash as the separator:
$input dsales
$date ddmmyyyy "-"
$output dexport
$xeq
Suprtool 4.6.01 for HP-UX User Manual STExport Commands
• 203