Thank you Peter.
   Interesting you use type *DOS for the output and I was looking at *YYMD
   which seems to give CCYYMMDDHHMMSSMMM
   I see, *DOS give a century indicator and additional milliseconds.
   [1]
https://www.ibm.com/docs/en/i/7.4.0?topic=ssw_ibm_i_74/apis/qwccvtdt.html
   I have taken your example and reworked for use in CL and broken the date
   and time up so it can be included in a message like "User profile XXXX was
   disabled on dd/mm/ccyy at 99:99:99."
   If you have any use for a cl version let me know and I will send it to
   you.
   Appreciate your help, thank you!
   Cheers
   Don
    
   Don Brown
   Senior Consultant
    
   [2]OneTeam IT Pty Ltd
   P: 1300 088 400
   -----Original Message-----
   From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
   Peter Dow
   Sent: Wednesday, 24 September 2025 3:54 PM
   To: midrange-l@xxxxxxxxxxxxxxxxxx
   Subject: Re: STRWCH question
   Hi Don,
   For the 2nd question you had, this is what I came up with when I ran into
   the same problem (converting the 8a message timestamp):
   /copy qsysinc/qrpglesrc,qusec
   p CvtTimStmp      b
   d                 pi              z
   d CvtDatTim       pr                  extpgm('QWCCVTDT') d  InpFmt       
                  10a   const d  InpValue                     20a   const
   options(*varsize) d  OutFmt                       10a   const d  OutValue 
                      20a   options(*varsize) d  ErrCde                     
          likeds(QUSEC) d  InpTZ                        10a   const
   options(*nopass) d  OutTZ                        10a   const
   options(*nopass) d  TZInfo                        1a   const
   options(*nopass) d  LenTZInfo                    10i 0 const
   options(*nopass) d  PrecInd                       1a   const
   options(*nopass) d  InpTimInd                     1a   const
   options(*nopass)
    *  DOSGetDateTime Value Structure
   d DOSds           ds                  qualified d  hours                 
          3u 0 d  minutes                       3u 0 d  seconds             
            3u 0 d  hSeconds                      3u 0 d  day               
              3u 0 d  month                         3u 0 d  year             
               5u 0 d  TimZonOffset                  5i 0 d  dayOfWeek       
                3u 0
   d TSds            ds                  qualified d  year                   
         4s 0 d                                1a   inz('-') d  month       
                    2s 0 d                                1a   inz('-') d 
   day                           2s 0 d                                1a 
    inz('-') d  hours                         2s 0 d                         
         1a   inz('.') d  minutes                       2s 0 d               
                   1a   inz('.') d  seconds                       2s 0 d     
                             1a   inz('.') d  hSeconds                     
   2s 0 d                                4a   inz('0000')
      CvtDatTim('*DTS' : EventDataDS.MsgTimestamp : '*DOS' :DOSds : QUSEC);
      eval-corr TSds = DOSds;
      return %timestamp(TSds);
   p                 e
   --
   *Peter Dow* /
   909 793-9050
   petercdow@xxxxxxxxx
   /
   On 9/23/2025 5:43 PM, Don Brown via MIDRANGE-L wrote:
   > I am testing a watch program to process messages from the QSYSMSG
   message queue.
   >
   > In the program I have at the very beginning to enable verbose
   > debugging while I do testing
   >
   > chgjob log(4 0 *seclvl) logclpgm(*yes)
   >
   > But I can find any active or ended job or spool file with the joblog
   details. I know the program is being called as I receive an email that is
   generated from the watch program.
   >
   > My second question is in the event data provided to the watch program
   there is Message timestamp, type char(8) that I want to convert to a value
   that can be used in a message but what I have tried has failed and
   searching has not been successful in finding the format this value is in.
   >
   > 378
   > 17A
   > CHAR(8)
   > Message timestamp
   >
   > Any suggestions or links appreciated.
   >
   > Thanks
   > Don
   >
   >
   > Brisbane - Sydney - Melbourne
   >
   >
   > Don Brown
   >
   > Senior Consultant
   >
   >
   >
   >
   > P: 1300 088 400
   >
   >
   >
   >
   > DISCLAIMER. Before opening any attachments, check them for viruses and
   > defects. This email and its attachments may contain confidential
   > information. If you are not the intended recipient, please do not
   > read, distribute or copy this email or its attachments but notify
   > sender and delete it. Any views expressed in this email are those of
   > the individual sender
   --
   This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
   list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
   unsubscribe, or change list options,
   visit: [3]
https://lists.midrange.com/mailman/listinfo/midrange-l
   or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
   Before posting, please take a moment to review the archives at
   [4]
https://archive.midrange.com/midrange-l.
   Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
   questions.
   --
   Message protected by MailGuard: e-mail anti-virus, anti-spam and content
   filtering.
   [5]
https://www.mailguard.com.au
References
   Visible links
   1. 
https://www.ibm.com/docs/en/i/7.4.0?topic=ssw_ibm_i_74/apis/qwccvtdt.html
   2. 
https://www.oneteamit.com.au/
   3. 
https://lists.midrange.com/mailman/listinfo/midrange-l
   4. 
https://archive.midrange.com/midrange-l.
   5. 
https://www.mailguard.com.au/
As an Amazon Associate we earn from qualifying purchases.