View previous topic :: View next topic
|
Author |
Message |
santhukumar
New User
Joined: 18 Sep 2009 Posts: 3 Location: India
|
|
|
|
I'm facing a problem in deducting 5 minutes from a given time.
I get the system generated date and time and I need to populate the time by subtracting 5 minutes from the system generated time.
Need a help in subtracting the minutes from HHMMSS.
Please let me know if there is any function like Integer of Date for DATE. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
I am sorry I didn't answer you immediately, 11 minutes is a long time to wait. Just separate the time into three signed numeric fields hh, mm, and ss. Subtract 5 from mm, if the result is less than 0 add 60 to mm and subtract 1 from hh. Then recombine the three fields into one field. If hh is less than 0 you have a problem and you will have to figure it out your self. |
|
Back to top |
|
|
bijal.awhad
New User
Joined: 19 Mar 2008 Posts: 51 Location: Pune
|
|
|
|
Hi,
Convert the system generated time into seconds. Subtract 300 secconds from that.
Convert the result back to HHMMSS.
Regards
Bijal |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
Back to top |
|
|
santhukumar
New User
Joined: 18 Sep 2009 Posts: 3 Location: India
|
|
|
|
Hi Bijal,
Thanks for your reply.
What if the system generated time in seconds is less than 300? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
What if the system generated time in seconds is less than 300? |
that' s an issue You have to solve Yourself
if the time is a full timestamp, a proper algorithm will take You back to the previous day
hint ... convert the full timestamp to seconds/minutes subtract reconvert !
see
ibmmainframes.com/viewtopic.php?t=45058&highlight=subtract
a rexx prototype for the issue |
|
Back to top |
|
|
bijal.awhad
New User
Joined: 19 Mar 2008 Posts: 51 Location: Pune
|
|
|
|
Hi Santhosh
As suggested by enrico, you have to take care of it in your code.
Please try & if you still face the issue, let us know.
I think you have got enough of suggestions to get started. So All the Best.
Regards
Bijal |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Take a look at the LE Callable Service routine "CEESECS".
Bill
PS: Oops, sorry Enrico, just saw your link.... |
|
Back to top |
|
|
santhukumar
New User
Joined: 18 Sep 2009 Posts: 3 Location: India
|
|
|
|
Hi,
Thanks for your replies.
When I am using INTEGER-OF-DATE function in my program i am getting the following error message.
Compiler is ,NOCMPR2 (IBM VS COBOL II Release 4.0 09/15/92)
1. "FUNCTION" was not defined as a data-name. The statement was discarded.
2. "INTEGER-OF-DATE" was invalid. Skipped to the next verb, period or procedure-name definition.
3. "DATE-OF-INTEGER" was invalid. Skipped to the next verb, period or procedure-name definition.
Please help. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
COBOL Intrinsic Functions were introduced with COBOL/370, which was the successor to VS/COBOL II (your COBOL version/release), so you're out of luck with this idea.
Check with your System's staff as to whether Language Environment is installed in your LPAR and then review "CEESECS".
If not, then it will be a manual process, which may not be as difficult as you perceive.
Bill |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
santhukumar wrote: |
What if the system generated time in seconds is less than 300? |
You will have to borrow from the DD column..... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you work thru a few "samples" using the process Craig posted (including the case when the calculated "time" is the preceeding day).
Once you have written down the individul steps as you work the samples with a pencil, you can convert these steps to code.
If you cannot document the steps you follow, code should not be undertaken. . . |
|
Back to top |
|
|
|