• Subject: R: Questions on CONVERT-DATE-TIME and ADD-DURATION
  • From: Finucci Domenico <finucci@xxxxxxxxxxxx>
  • Date: Mon, 28 Feb 2000 09:30:22 +0100
  • Cc: "'Robert E. Burger'" <rburger@xxxxxxxx>

-----Messaggio originale-----
Da: Robert E. Burger [mailto:rburger@home.net]
Inviato: domenica 27 febbraio 2000 08.20
A: cobol400-L@midrange.com
Oggetto: Questions on CONVERT-DATE-TIME and ADD-DURATION

Answer : 
Try to edit the program this way:

        01 w-SYSTEM-DATE           pic x(21).
(**)    01 w-date-1                             pic x(26).
        01 w-SYSTEM-TIME           FORMAT TIME.

(**) You know that the format for a timestamp item must be:
"YYYY-MM-DD-hh.mm.ss.nnnnnn"  where nnn is 1000th sec,
           26 byte total.

 move w-system-date(1:4)  to w-date-1(1:4)
 move "-"                                  to w-date-1(5:1)
 move w-system-date(5:2)  to w-date-1(6:2)
 move "-"                                  to w-date-1(8:1)
 move w-system-date(7:2)  to w-date-1(9:2)
 move "-"                                  to w-date-1(11:1)
 move w-system-date(9:2)  to w-date-1(12:2)
 move "."                                  to w-date-1(14:1)
 move w-system-date(11:2) to w-date-1(15:2)
 move "."                                   to w-date-1(17:1)
 move w-system-date(13:2) to w-date-1(18:2)
 move "."                                    to w-date-1(20:1)
 move "000000"                       to w-date-1(21:6)
 display "w-date-1 " w-date-1

Let me know if this works on yr. AS/400 too.
D. Finucci
Fiditalia SPA, Milano

| This is the COBOL/400 Mailing List!
| To submit a new message, send your mail to COBOL400-L@midrange.com.
| To subscribe to this list send email to COBOL400-L-SUB@midrange.com.
| To unsubscribe from this list send email to COBOL400-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 thread ...


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

This mailing list archive is Copyright 1997-2022 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.