We use MS 6.2.02 (due to circumstances beyond my control, upgrading isn't an option right now) to run PowerBuilder exe's on a scheduled basis. Each macro simply contains the the "Run Program>..." command.
I have seen numerous cases in which multiple macros are scheduled to run at the same time, and it is common that one or more of the macros is skipped.
Here is a snippet of the log file generated for two consecutive minutes. In Macro Scheduler, the macros scheduled at 2 AM are Macro1, Macro2, and Macro3. The macro scheduled at 2:01 AM is Macro4.
10/26/2004 02:00:00:280 - Started Macro : Macro1
10/26/2004 02:00:29:920 - Run Program>E:\pgm_1.exe
10/26/2004 02:00:30:030 - Started Macro : Macro2
10/26/2004 02:01:00:108 - Run Program>E:\pgm_2.exe
10/26/2004 02:01:00:186 - Started Macro : E:\Macro4
10/26/2004 02:01:15:108 - Run Program>E:\pgm_4.exe
By the time Macro1 and Macro2 have been executed (in a synchronous fashion, it appears), it's no longer 2 AM. Thus, Macro3 was skipped. Macro4 was then executed. Note that there is a significant amount of time between the "Started Macro" and "Run Program" entries.
Is this a known issue? Does anyone have any advice that would help to solve this problem?
Thanks for you help,
JB
One or more macros scheduled in same minute are skipped
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Rather than having Macros 1-4 on a tight schedule, Consider:
1.Make each macro call the following macro in its last line. Eg: Macro1 calls Macro2 which calls Macro3 which calls Macro4.
OR
2. Have each Macro trigger to start when another Window appears. Have the last line of each preceeding macro open the window that will trigger that macro.
-------------------------
It may also be necessary for you to use Let>RP_WAIT=1 with Run Program> especially when calling/nesting macros. It may be critical that the first RunProgram be completely done before proceeding to the next macro.
1.Make each macro call the following macro in its last line. Eg: Macro1 calls Macro2 which calls Macro3 which calls Macro4.
OR
2. Have each Macro trigger to start when another Window appears. Have the last line of each preceeding macro open the window that will trigger that macro.
-------------------------
It may also be necessary for you to use Let>RP_WAIT=1 with Run Program> especially when calling/nesting macros. It may be critical that the first RunProgram be completely done before proceeding to the next macro.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Follow up to your ideas
Thank you for your response Bob!
I had considered something like your first option, i.e., I had thought of placing multiple "Run Program>" commands in the same macro. However, if the multiple "Run Program" commands take too long to complete (say from 2:01:00 to 2:03:11), I am guessing that the macros scheduled at 2:02 might be skipped. Do you agree?
I assume that Macro Scheduler can only handle execution of one macro at a time (i.e., when one scheduled macro finishes, only then can the next scheduled macro start). Is that correct?
Can you explain the number of seconds it takes between "Start Macro" and "Run Program" to be logged? It seems extreme that it would take upwards of 30 seconds.
I greatly appreciate any further thoughts on the matter,
JB
I had considered something like your first option, i.e., I had thought of placing multiple "Run Program>" commands in the same macro. However, if the multiple "Run Program" commands take too long to complete (say from 2:01:00 to 2:03:11), I am guessing that the macros scheduled at 2:02 might be skipped. Do you agree?
I assume that Macro Scheduler can only handle execution of one macro at a time (i.e., when one scheduled macro finishes, only then can the next scheduled macro start). Is that correct?
Can you explain the number of seconds it takes between "Start Macro" and "Run Program" to be logged? It seems extreme that it would take upwards of 30 seconds.
I greatly appreciate any further thoughts on the matter,
JB
Following Bob's suggestion it would look like this (only script A is scheduled).
A.scp
//at the last line of script A you're calling macro B
Macro>C:\B.scp
Exit
B.scp
//at the last line of script B you're calling macro C
Macro>C:\C.scp
Exit
C.scp
//at the last line of script C you're calling macro D
Macro>C:\D.scp
Exit
D.scp
Exit
If the "macro calling macro calling macro" is scheduled at 2:00 AM and has several "Run Program" commands that each take around 30 seconds, isn't it likely that this macro would not be done executing until 2:02 or later.
In this scenario, wouldn't the "macro calling macro calling macro" scheduled at 2:01 AM be skipped? It seems that, while MS is busy executing the first macro, it can't do anything else. If the macro it's executing takes until after 2:02 to finish, MS misses the 2:01 AM macro because if was doing something else from 2:00 AM through 2:02.
Is my description of MS behavior accurate?
In this scenario, wouldn't the "macro calling macro calling macro" scheduled at 2:01 AM be skipped? It seems that, while MS is busy executing the first macro, it can't do anything else. If the macro it's executing takes until after 2:02 to finish, MS misses the 2:01 AM macro because if was doing something else from 2:00 AM through 2:02.
Is my description of MS behavior accurate?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
As Lumumba pointed out, only the first macro is scheduled.
This does cause them to be sequential. Is it mandatory that they run one minute apart even if first is not done? In that case, start Macro1, do not use RP_WAIT=1, and then call macro 2 one minute after macro1 has started. Use same approach in Macros2, 3 when they call Macros3, 4.
Macro1
Let>RP_WAIT=0
Run Program>......
Wait>60
Call Macro2
-------------------
Macro2
Let>RP_WAIT=0
Run Program>......
Wait>60
Call Macro3
-------------------
Macro3
Let>RP_WAIT=0
Run Program>......
Wait>60
Call Macro4
-------------------
Macro4
Let>RP_WAIT=0
Run Program>......
End
-------------------
This does cause them to be sequential. Is it mandatory that they run one minute apart even if first is not done? In that case, start Macro1, do not use RP_WAIT=1, and then call macro 2 one minute after macro1 has started. Use same approach in Macros2, 3 when they call Macros3, 4.
Macro1
Let>RP_WAIT=0
Run Program>......
Wait>60
Call Macro2
-------------------
Macro2
Let>RP_WAIT=0
Run Program>......
Wait>60
Call Macro3
-------------------
Macro3
Let>RP_WAIT=0
Run Program>......
Wait>60
Call Macro4
-------------------
Macro4
Let>RP_WAIT=0
Run Program>......
End
-------------------
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!