|
Hello all, I am working with the following for the last few days and have not ben able to convert the 8 byte receiver from the C / MI function, buitin function MATTOD "Materialize Time of Day" to some more readeable format. Particularly *DTS that gives me microseconds pressision In the Midrange archives the following link provides a good background http://archive.midrange.com/rpg400-l/200001/msg00406.html Mr Bruce Vining suggested in the past that the QWCCDTDT would be a good candidate to do this. Unfortunately I still have difficulty figuring out how to create the handshake of these pieces For example a receiver of '826C57DD56E28000' should be something like 2001-05-08.hh.mm.ss.uuuuuu .... Yes, Yes .. I confess I want those precious microseconds :-) Need a little help from the bits and bytes gurus Thanks you for your help in advance Jorge Moreno Systems Analyst Woodbury, New York Below tthe information for the QWCCDTDT api Convert Date and Time Format (QWCCVTDT) API |-----------------------| | Required Parameter | | Group: | | | | | | | | | | | | | | 1| | Input format | | Input | | Char(1| | 0) | | 2| | Input variable | | Input | | Char | | (*) | | 3| | Output format | | Input | | Char(1| | 0) | | 4| | Output variable | | Output | | Char | | (*) | | 5| | Error code | | I/O | | Char | | (*) | | | | | | | | | | Threadsafe: Yes | |-----------------------| The Convert Date and Time Format (QWCCVTDT) API converts date and time values from one format to another format. The QWCCVTDT API lets you: Convert a time-stamp (*DTS, for system time-stamp) value to character format Convert a character date-time value to time-stamp format Convert a date from one character format to another Retrieve the current machine clock time and return it in the format you specify For the ILE CEE date and time APIs, see Date and Time APIs in The System API Reference SC41-5801. Required Parameter Group Input format INPUT; CHAR(10) The format of the data you give QWCCVTDT to convert. Valid values are: *CURRENT Current machine clock time. *DTS System time-stamp. When you convert a character date-time value to *DTS and back to character format, there is a rounding error of plus or minus 2 milliseconds. *JOB The format given in the DATFMT job attribute. *SYSVAL The format given in the QDATFMT system value. *YMD YYMMDD (year, month, day) format. *YYMD YYYYMMDD (4-digit year, month, day) format. *MDY MMDDYY (month, day, year) format. *MDYY MMDDYYYY (month, day, 4-digit year) format. *DMY DDMMYY (day, month, year) format. *DMYY DDMMYYYY (day, month, 4-digit year) format. *JUL Julian format (YYDDD (year, day of year)). *LONGJUL Long Julian format (YYYYDDD (4-digit year, day of year)). All date values range only from August 23, 1928, 12:03:06.315 to May 10, 2071, 11:56:53.684. Converting a date outside this range to any of these formats results in a date within this range. You can convert any format except *CURRENT to the same format without receiving an error. When you convert a format to the same format, the input variable is copied into the output variable without validation. When you convert one character date format (that is, anything other than *CURRENT, the current machine-clock time, or *DTS, the system time-stamp) to another character date format, the date information is validated and converted. However, the time and milliseconds portions of the input variable are copied into the output variable without validation. Also, if both the input format and the output format specify a century digit and a 2-digit year (for example, converting *YMD to *MDY), the century digit of the input variable is copied to the output variable without validation. Input variable INPUT; CHAR(*) The data to be converted. See Input Variable Format to determine the input variable. Output format INPUT; CHAR(10) The format to convert the data to. Valid values are: *DTS System time-stamp. For additional information, see the description of the *DTS value under the input format parameter. *JOB The format given in the DATFMT job attribute *SYSVAL The format given in the QDATFMT system value *YMD YYMMDD format *YYMD YYYYMMDD format *MDY MMDDYY format *MDYY MMDDYYYY format *DMY DDMMYY format *DMYY DDMMYYYY format *JUL Julian format (YYDDD) *LONGJUL Long Julian format (YYYYDDD) *DOS DOSGetDateTime format. The *DOS value can be specified only when *CURRENT or *DTS is specified for the input format parameter. Output variable OUTPUT; CHAR(*) The converted data. If the output format is *DTS, the first 8 characters of this parameter are used. If the output format is *DOS, the first 11 characters of this parameter are used. For details, see DOSGetDateTime Value Structure. If the output format is *YYMD, *MDYY, *DMYY or *LONGJUL, the first 17 characters of the output variable are used. For details, see 17-Byte Character Date and Time Value Structure . If the output format is one of the other character formats (that is, anything other than *DTS, *DOS, *YYMD, *MDYY, *DMYY or *LONGJUL) the first 16 characters of the output variable are used. For details, see 16-Byte Character Date and Time Value Structure. Error code I/O; CHAR(*) The structure in which to return error information. For the format of the structure, see Error Code Parameter. Input Variable Format This table shows the format used for the input variable parameter. |-----------------------------+---------------------------------------------------------| | Input Format | Input Variable | | |-----------------------------+---------------------------------------------------------| | *CURRENT | Parameter is ignored. | | |-----------------------------+---------------------------------------------------------| | *DTS | System time-stamp. The first 8 characters are |used. | |-----------------------------+---------------------------------------------------------| | *YYMD, *MDYY, *DMYY, | The first 17 characters are used. See 17-Byte |Character | | *LONGJUL | Date and Time Value Structure. | | |-----------------------------+---------------------------------------------------------| | All other character formats | The first 16 characters are used. See 16-Byte |Character | | | Date and Time Value Structure. | | |-----------------------------+---------------------------------------------------------| 16-Byte Character Date and Time Value Structure This table shows the structure used for the input and output variables when the format is *JOB, *SYSVAL, *YMD, *MDY, *DMY and *JUL. |------+--------------------------------------------------------------------------| | Offse| Description | | | t | | | |------+--------------------------------------------------------------------------| | 0 | Century, where 0 indicates years 19xx and 1 indicates years 20xx. | | |------+--------------------------------------------------------------------------| | 1-6 | Date, left-justified. This value cannot be all blanks or all zeros. | | | | Left-justify Julian dates, using blanks to fill the space. | | |------+--------------------------------------------------------------------------| | 7-12 | Time, in HHMMSS (hours, minutes, seconds) format. | | |------+--------------------------------------------------------------------------| | 13-15| Milliseconds. This value cannot be blanks. | | | | | | |------+--------------------------------------------------------------------------| 17-Byte Character Date and Time Value Structure This table shows the structure used for the input and output variables when the format is *YYMD, *MDYY, *DMYY and *LONGJUL. |------+--------------------------------------------------------------------------| | Offse| Description | | | t | | | |------+--------------------------------------------------------------------------| | 0-7 | Date, left-justified. This value cannot be all blanks or all zeros. | | | | Left-justify Julian dates, using blanks to fill the space. | | |------+--------------------------------------------------------------------------| | 8-13 | Time, in HHMMSS (hours, minutes, seconds) format. | | |------+--------------------------------------------------------------------------| | 14-16| Milliseconds. This value cannot be blanks. | | | | | | |------+--------------------------------------------------------------------------| DOSGetDateTime Value Structure This table shows the structure used for the output variables. |------+---------------------------------------------------------------| | Offse| Description | | t | | |------+---------------------------------------------------------------| | 0 | Hours (0-23)(superscript: 1) | |------+---------------------------------------------------------------| | 1 | Minutes (0-59)(superscript: 1) | |------+---------------------------------------------------------------| | 2 | Seconds (0-59)(superscript: 1) | |------+---------------------------------------------------------------| | 3 | Hundredths of seconds (0-99)(superscript: 1) | |------+---------------------------------------------------------------| | 4 | Day (1-31)(superscript: 1) | |------+---------------------------------------------------------------| | 5 | Month (1-12)(superscript: 1) | |------+---------------------------------------------------------------| | 6-7 | Year (for example, 1995)(superscript: 2) | |------+---------------------------------------------------------------| | 8-9 | Time zone. This is the negative value of the system value | | | QUTCOFFSET converted into minutes.(superscript: 2) | |------+---------------------------------------------------------------| | 10 | Day of the week. Sunday is 0. (0-6)(superscript: 1) | |------+---------------------------------------------------------------| |Notes: | | | | | |(superscript: 1) | |A 1-byte integer. | | | | | |(superscript: 2) | |A 2-byte integer. | ---------------------------------------------------------------| Error Messages CPF1060 E Date not valid. CPF1061 E Time not valid. CPF1848 E Century digit &1 not valid CPF1849 E Milliseconds value &1 not valid CPF1850 E Format &1 not valid CPF24B4 E Severe error while addressing parameter list. CPF3C90 E Literal value cannot be changed. CPF3CF1 E Error code parameter not valid. CPF9872 E Program or service program &1 in library &2 ended. Reason code &3. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.