Search code examples
ibm-midrange

DDS TIMFMT. Is it possible to get hh:mm?


I have a time input field in a display record, and I want it to be in the format hh:mm. The available formats either have seconds or AM/PM afterwards. The following is what I would like to do, but it doesn't work since the format doesn't exist.

A            SRTTIME         T  B  5 43TIMSEP(':') TIMFMT(*HM)

Is there an easy way to accomplish what I want without changing the field to a simple character field? I'm running on v7.1.


Solution

  • I suggest using a 4 digit numeric field with an EDTWRD. You might also consider EDTCDE(Y) DATSEP(':'). Or take a look at the "user-defined" edit codes on your system, named QEDIT5 - QEDIT9, with the DSPEDTD or WRKEDTD command. Or consider other keyboard shift codes in column 31.

    ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
         A        TM1            4S 0B      3  4EDTWRD('0 :  ')
         A                                      EDTMSK('  &  ')
         A        TM2            4S 0B      4  4EDTCDE(Y) 
         A                                      DATSEP(':') 
         A 
    

    See the DDS Reference