On Mon, 10 Jan 2011 14:57:51 +0100, Miklos Szigetvari <miklos.szigetv...@isis-papyrus.com> wrote:
>Hi > >Would like to get in WTP messages the time stamps in 1/100 seconds. >Is it possible in 2011 ? It is possible in Assembler... BASEREG EQU R2 Base register for main loop. PARMREG EQU R3 To address parameter value. WORKREG EQU R4 To address provided work area. *---------------------------------------------------------------------- NSTIMSTP CSECT NSTIMSTP AMODE 31 Can run in 31 bit addressing NSTIMSTP RMODE ANY mode and reside above * EDCPRLG BASEREG=BASEREG Language Environment prolog. * This saves the registers and * establishes addressability. L PARMREG,0(,R1) Get parameter address USING RESULT,PARMREG L WORKREG,4(,R1) Get workarea address USING WORKAREA,WORKREG SR R15,R15 ST R15,SYSTIME+12 Zero the fourth word of the * TIME output parameter. TIME DEC,SYSTIME, Get system time. * DATETYPE=YYYYMMDD, * ZONE=LT, * LINKAGE=SYSTEM, * MF=(E,TIMELST) MVC TSP,OUTMASK Prepare edit mask. ED YEAR(11),DECDATE Move digits of date in. ED HOUR(16),DECTIME Move digits of time and null * terminator in. EDCEPIL Language Environment epilog. EJECT *---------------------------------------------------------------------- RESULT DSECT TSP DS 0CL27 YEAR DS 4C DS 1C Dash MONTH DS 2C DS 1C Dash DAY DS 2C DS 1C Dash HOUR DS 2C DS 1C Dot MINUTE DS 2C DS 1C Dot SECOND DS 2C DS 1C Dot MICRO DS 6C DS 1C Null terminator *---------------------------------------------------------------------- WORKAREA DSECT SYSTIME DS 4F ORG SYSTIME DECTIME DS CL8 DECDATE DS CL4 ORG * TIMELST TIME LINKAGE=SYSTEM, Get system time. * MF=L *---------------------------------------------------------------------- NSTIMSTP CSECT OUTMASK DS C'yyyy-mm-dd-hh.mm.ss.uuuuuuN' ORG OUTMASK DC X'21' Significance starter DC X'20' Digit selector DC X'20' Digit selector DC X'20' Digit selector DC C'-' DC X'20' Digit selector DC X'20' Digit selector DC C'-' DC X'20' Digit selector DC X'20' Digit selector DC C'-' DC X'21' Significance starter DC X'20' Digit selector DC C'.' DC X'20' Digit selector DC X'20' Digit selector DC C'.' DC X'20' Digit selector DC X'20' Digit selector DC C'.' DC X'20' Digit selector DC X'20' Digit selector DC X'20' Digit selector DC X'20' Digit selector DC X'20' Digit selector DC X'20' Digit selector DC X'00' Null terminator ORG * LTORG Literal pool EJECT You may have a bit of re-formatting to do, but this sub-routine will give you a timestamp in the format DB2 uses to externalize timestamps: yyyy-mm-dd- hh.mm.ss.uuuuuu The 00 byte at the end makes the result readily usable as a C string. Feel free to amend to show only hundreths of seconds and to include that in the text of you WTP. Cheers, Jantje. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html