View previous topic :: View next topic
|
Author |
Message |
David Smith
New User
Joined: 28 Oct 2008 Posts: 9 Location: WA state
|
|
|
|
I've come across a program that produces messages. It checks to see if the current time (*TIMN) matches the time of the last message produced (HHMMSST), as it does not want to set any messages with the same create time.
If the current time matches the saved time #TIME, it adds 10 to #TIME and stores that instead of *TIMN. This has led to some records with create time seconds = to 60, which is invalid.
I can think of several relatively easy fixes. Such as resetting seconds and adding to minutes (checking that minutes don't go over 59 as well), or to use a repeat loop until the current time is not equal to the saved time.
But, it got me wondering if there is some type of Natural command that efficiently stops processing momentarily? For example, if *TIMN = saved time, wait 1 second, then move *TIMN to the create time? |
|
Back to top |
|
|
David Smith
New User
Joined: 28 Oct 2008 Posts: 9 Location: WA state
|
|
|
|
I just ran a test using the REPEAT UNTIL idea. And it spun thru the loop several thousand times before the time was not equal |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yup, that method is only good for increasing cpu usage. . .
Changing to use some other uniqueness value might be considered. . . |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Software AG provides the SUSPEND example program that couled easily be located in SYSEXTP library (or MAINMENU --> Example Libraries --> Examples of TP-Specific Functions).
SUSPEND uses the CMROLL assembler program, and is supported under all environments (CICS/BATCH/TSO etc.).
O. |
|
Back to top |
|
|
David Smith
New User
Joined: 28 Oct 2008 Posts: 9 Location: WA state
|
|
|
|
Interesting! I gave this a try and it works great. I may utilize a call to CMROLL in the program. Thank you |
|
Back to top |
|
|
|