× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks, Tim, that worked nicely - now to make a stored procedure to use with the SQL service - or ask IBM to make some kind of SQL procedure for us.

Cheers
Vern

On 10/23/2020 5:26 AM, Tim Bronski wrote:
As an example, here's a snippet of C code that converts to an OS400 timestamp. You can adjust accordingly.

int convertMIFormatToOS400TimeStamp(const char miForm[8], char timeStampField[26])

Qus_EC_t errCode;
char inFmt[10], outFmt[10];
char workingDate[20];

  memset (inFmt,' ', 10);
  memset (outFmt,' ', 10);
  memcpy (inFmt,"*DTS",4);
  memcpy (outFmt,"*YYMD",5);
  errCode.Bytes_Provided = sizeof(errCode);

  memset (workingDate, '0', sizeof(workingDate));
  QWCCVTDT(inFmt, (void *)miForm, outFmt, workingDate, &errCode, "*SYS      ", "*SYS      ", NULL, 0, "1");
  // If no errors in retrieve
  if (errCode.Bytes_Available==0) {
    memcpy(timeStampField+4, "-  -  -  .  .  .", 16);
    memcpy(timeStampField, workingDate, 4);         // yyyy
    memcpy(timeStampField+5, workingDate+4, 2);     // mm
    memcpy(timeStampField+8, workingDate+6, 2);     // dd
    memcpy(timeStampField+11, workingDate+8, 2);    // hh
    memcpy(timeStampField+14, workingDate+10, 2);   // mm
    memcpy(timeStampField+17, workingDate+12, 2);   // ss
    memcpy(timeStampField+20, workingDate+14, 6);   // milli
    return 0;
  } else
    return -1;

}

On 10/23/2020 8:33 AM, Vernon Hamberg wrote:
Hi all

There are 3 UTC data types in message data fields. In particular, message CPF1241 has these in the message data.

I would like to extract them for use in the HISTORY_LOG table function. They are each 8-byte values - does anyone know how to get a presentation value? They are supposed to have date and or time that is adjusted for UTC offset - something like that.

I've looked at the MI CVTD function, but there isn't anything obvious there. I've not yet looked at other date/time conversion functions.

Cheers
Vern


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.