|
Hi Narsi, > > We are in the process of testing responses in our application. I would > > like to check out the time a particular API takes to complete on the > > AS400 by writing a timestamp into the job log first thing and then > > writing the time stamp again as the last line of code. How does one > > write a timestamp into the job log from a CL program ? I have a few comments: a) The ">" symbols to the left of the text in an e-mail message are supposed to specify what you're replying to. Please don't put ">" symbols to the left of new text that you're writing, it makes it difficult to read your message. b) The correct place for CL programming questions is MIDRANGE-L c) This is the RPG forum, so even though you asked how to do this in CL, I'm going to give you an example in RPG. In RPG, you need to use an API to write a message to the job log, but you can get the timestamp natively. In CL, the opposite is true, there are commands to write messages to the job log, but you need an API to get the timestamp. Go figure. Here's my RPG solution: H DFTACTGRP(*NO) D Diag PR D Message 256A varying const c callp diag('before = ' + %char(%timestamp())) C*** do API call here c callp diag('after = ' + %char(%timestamp())) c eval *inlr = *on *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Diag(): Quick & Dirty routine to write a diagnostic msg to * the job log. *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ P Diag B D Diag PI D Message 256A varying const D QMHSNDPM PR ExtPgm('QMHSNDPM') D MessageID 7A Const D QualMsgF 20A Const D MsgData 32767A Const options(*varsize) D MsgDtaLen 10I 0 Const D MsgType 10A Const D CallStkEnt 10A Const D CallStkCnt 10I 0 Const D MessageKey 4A D ErrorCode 8192A options(*varsize) D dsEC DS D dsEC_BytesP 1 4I 0 inz(0) D dsEC_BytesA 5 8I 0 inz(0) D MsgKey s 4A c callp QMHSNDPM( 'CPF9897' c : 'QCPFMSG *LIBL' c : Message c : %len(Message) c : '*DIAG' c : '*' c : 1 c : MsgKey c : dsEC ) P E
As an Amazon Associate we earn from qualifying purchases.
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.