any audit/security/legal_compliance group of <any> organization would define what <you> are trying to do as a <forgery>
With out knowing why exactly I am asking this question, I think this is unfair to say
Quote:
is <anybody> in Your organization aware of that
Yes, every body is aware of this. we figured out many ways for this requirement.
I thought let me give a try here. if not possible here, then thinking of writing a new cobol program.
You really want to know the requirement, here it is!!
In IDMS, to extract the Print Logs from Data Base dump messages, we need to pass the start and end time stamp as input to the utility 'IDMSBCF'. We need to extract each 10 minutes data in to one dataset. So, we have to pass 2 time stamps (current and 10 mins back time stamps) and schedule the job for every 10 minutes. So, I need these 2 times in a file in 2 different rows.
Enrico,
Do you/audit/security/legal_compliance group see any issues here, Please let me know !!
With out knowing why exactly I am asking this question, I think this is unfair to say
given the original post wording I have nothing to regret about my answer
learn to post better description of Your issues and nobody will be concerned about legal issues
( whenever they do not apply )
if You had posted something like ...
I need to create two timestamps for data extraction
would have saved lots of confusion and useless network traffic
I would not have even cared to answer
Quote:
Do you/audit/security/legal_compliance group see any issues here, Please let me know !!
just drop the condescending tone please ...
I made a serious remark, out of events that I have seen happen in real life
but it looks like You did not appreciate my concerns ...
in this case the words of Rhett Butler apply
With knowledge that I have, all I can think of only these options JOb with COBOL program or a SORT step or Rexx pgm.
Rexx is not accepted in our production.
So, I am left with other 2.
But If you have any other ideas, I am happy to at least know about them if not implement.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
DFSORT does not have any built-in functions for subtracting 10 minutes from a timestamp.
If you can determine how to do this arithmetically with a program, you could probably do it with DFSORT's arithmetic functions as well. Kolusu is better at this kind of thing then I am, but he's on vacation today.
There should be a way to use a standard utility ( or DFSORT ) to read the first timestamp, imbed it into a generated DB2 SELECT statement that does timestamp arithmetic to add 10 minutes, and then pass that generated SELECT statement to a DB2 Utility ( Batch SPUFI?, DSNUTILB?, DSNTEP2? ) to output the second timestamp, and follow that with a third utility ( or DFSORT ) step to reformat the output timestamp back into the format you want/need.
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
You will have a date change if the timestamp is (for example) 23:51:00 and you add 10 minutes, you'd be at one minute past midnight, the next day. What if your associated datestamp were the last day of the month or 31 December and the timestamp is as outlined above?
And heaven forbid that the first timestamp was 11:51 p.m. on Feb 28th in a leap year.
All good reasons why I suggested using DB2 to do the date arithmetic - DB2 takes all of those into consideration and yields the "correct" result every time.
strong opinion ...
to bother db2 for a silly date calculation is too much
here a stupid 12liners rexx snippet that will do it ... tested
the relevant code is 12 lines ( looks longer because of the housekeeping for the back and forth test )
Code:
numeric digits 40
tmstmp1 = "2003-02-19-00.05.01"
say tmstmp1
parse var tmstmp1 year "-" mnth "-" days "-" hh "." mm "." ss
btime = date("b", year || mnth || days ,"s") * ( 3600 * 24 ) + hh * 3600 + mm * 60 + ss
btime = btime - 600
tmstmp1 = s2t(btime)
say tmstmp1
parse var tmstmp1 year "-" mnth "-" days "-" hh "." mm "." ss
btime = date("b", year || mnth || days ,"s") * ( 3600 * 24 ) + hh * 3600 + mm * 60 + ss
btime = btime + 600
tmstmp1 = s2t(btime)
say tmstmp1
exit
s2t:procedure
parse arg t
s = right( ( t // 60 ), 2, "0")
m = right( ( t % 60 ) // 60, 2, "0")
h = right( ( ( t % 60 ) % 60 ) // 24 , 2, "0")
b = ( ( t % 60 ) % 60 ) % 24
d = date("S", b, "B")
return translate("0123-45-67-89.ab.cd", d||h||m||s, "0123456789abcd")
exit
from the first timestamp it will subtract 10 minutes ( delta expressed in seconds )
and it will add back to the result the same number of seconds
it works for an arbitrary seconds delta for the validity range of the REXX date function
tested for the leap year case
Posting solutions which are not acceptable only increases the volume of topic.
Balu, I would suggest to do a COBOL program since it helps in better understanding the requirement and reusability will be more.
Also if you are using DB2, then you will have to make sure that jobs are executed in DB2 supported environment.
Posting solutions which are not acceptable only increases the volume of topic.
did You ever hear about prototyping....
verify the correcteness of an approach/algorithm in a simple fashion
in order to implement afterwards in a <more suitable> way
This Link points to a COBOL example using LE services to do date/time arithmetic. A little modification to add input/output files might get the job done.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
vvmanyam,
With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707, you can use the new date conversion functions (TOJUL, TOGREG) like shown below to do the same thing: