mschedule.exe takes up all CPU

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
ncentech
Newbie
Posts: 7
Joined: Tue Oct 05, 2004 7:22 pm

mschedule.exe takes up all CPU

Post by ncentech » Tue Oct 05, 2004 7:34 pm

I have a few scripts that run on a daily basis 24/7. There is one that I am having problems with. This script chews up all the CPU and after a few minutes the program quits (MS). Any help will be greatly appreciated.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Oct 05, 2004 8:53 pm

Hard to see if it is a script problem without seeing the script.

Please post here, explain OS being used, local/network, etc.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed Oct 06, 2004 10:29 am

Hi Ncentech,

First of all, it's highly unlikely for Macro Scheduler to "chew up"all the CPU time. Would it be caused by a driver conflict issue?

Happy scriptinng.

ncentech
Newbie
Posts: 7
Joined: Tue Oct 05, 2004 7:22 pm

HEre is the script

Post by ncentech » Thu Oct 07, 2004 12:37 am

Label>Begin
'Begins process by first checking for a log file. Shows information, last update, version etc.

IfFileExists>%Path_Log_File%,MoveLog
Goto>StartLog

Label>MoveLog
'If Log Files are found it copies logs to ARCH directory and
'deletes source log.
MoveFile>%Path_Log_File%,%Path_Log_File_Arch%
Message>Previous ecom.log moved to archive
Wait>2


Label>StartLog
WriteLn>%Path_Log_File%,%StartDate% %StartTime% The ECOMMOVE program is running. Version %Version%

Label>BeginMove

'Gets the sleeptime from the Ini file
ReadIniFile>%EcomIni%,Settings,CycleTime,SleepTime

IfFileExists>%PathFrom%file.ref,Connected
Goto>DisConnect


Label>Connected
IfFileExists>%PathFrom%*.TXT,EcomCopy
GetTime>Time
GetDate>Date
WriteLn>%Path_Log_File%,%Date% %Time% No new Wholesale E-Commerce Files Found
Message>No new Wholesale E-Commerce Files Found
Wait>1
Goto>EcomCred

Label>EcomCopy
'This copies the Ecommerce files from T:\SQL70DEV to K:\APPS\WSL_TEST, writes to the log
GetFileList>%PathFrom%*.txt,files
Separate>files,;,file_names
Message>Num of Loan Application Files:%file_names_count%
WriteLn>%Path_Log_File%,%Date% %Time% Now Moving %file_names_count% Wholesale E-Commerce loan applications
wait>1
Let>k=0

Repeat>k
Let>k=k+1
Message>file_names_%k%
Wait>1
DateStamp>%Path_Log_File%,file_names_%k%
MoveFile>file_names_%k%,%PathDestination%

IfFileExists>file_names_%k%,NoMove
Goto>FileMoved

Label>NoMove
GetTime>Time
GetDate>Date
WriteLn>%Path_Log_File%,%Date% %Time% File Not Successfully Moved
Message>File Not Successfully Moved
SMTPSendMail>%Recipients%,%MailIP%,[email protected],Ecommerce Process,%Subject1%,%Body1%,
Goto>Done

Label>FileMoved
GetTime>Time
GetDate>Date
WriteLn>%Path_Log_File%,%Date% %Time% Loan Application File Successfully Moved
Message>Loan Application File Successfully Moved
Wait>1
Let>MoveCounter=MoveCounter+1
Label>Done

Until>k,file_names_count


'This will begin the moving credit files from E-Commerce to K:\apps\uniform\credit.

Label>EcomCred
IfFileExists>%Credit_From%*.nci,MoveCred
GetTime>Time
GetDate>Date
WriteLn>%Path_Log_File%,%Date% %Time% No new E-Commerce Credit Files Found
Message>No new Wholesale E-Commerce Credit Files Found
Wait>1

IfFileExists>%PathDestination%*.txt,EcomImport
Goto>EndMove

Label>MoveCred
GetTime>Time
GetDate>Date
GetFileList>%Credit_From%*.NCI,files
Separate>files,;,file_names
Message>Number of Credit Files: %file_names_count%
WriteLn>%Path_Log_File%,%Date% %Time% Moving %file_names_count% wholesale E-Commerce credit files.
wait>1
Let>z=0

Repeat>z
Let>z=z+1
Message>file_names_%z%
Wait>1
DateStamp>Log_File,file_names_%z%
MoveFile>file_names_%z%,%Credit_Destination%

IfFileExists>file_names_%z%,CredNoMove
Goto>CredFileMoved

Label>CredNoMove
GetTime>Time
GetDate>Date
WriteLn>%Path_Log_File%,%Date% %Time% Credit File Not Successfully Moved
Message>Credit File Not Successfully Moved
SMTPSendMail>%Recipients%,%MailIP%,[email protected],Ecommerce Process,%Subject1%,%Body2%,
Goto>Done

Label>CredFileMoved
GetTime>Time
GetDate>Date
DateStamp>%Path_Log_File%,file_names_%z%
WriteLn>%Path_Log_File%,%Date% %Time% Credit File Successfully Moved
Message>Credit File Successfully Moved
Wait>1
Let>CredCounter=CredCounter+1
Label>Done

Until>z,file_names_count

IfFileExists>%PathDestination%*.txt,EcomImport
Goto>EndMove

Label>EcomImport
'This handles the actual import into Uniform
Let>EcomCounter=EcomCounter+1
WriteLn>%Path_Log_File%,%Date% %Time% Checked For Files and Files were found.
WriteLn>%Path_Log_File%,%Date% %Time% Preparing to Run Uniform Import...
Run Program>L:\apps\uniform\rtiwin32.exe wsl_ecom /d=18
'MessageModal>Uniform is Running
wait>15
WaitWindowClosed>UNI-FORM Loan Processing
WriteLn>%Path_Log_File%,%Date% %Time% Uniform Import is complete.
Wait>1
Goto>EndMove

Label>EndMove
GetTime>TIME
MidStr>TIME,1,2,HH
MidStr>TIME,10,11,AMPM
ConCat>TIME_MIN,AMPM
If>AMPM=AM,SleepChk
IF>HH=12,SleepChk
If>HH>08,END

Label>SleepChk
If>SleepTime=0,BeginMove
Let>SleepTime=SleepTime-1
Message>Countdown Until Next Import %SleepTime% Imported %EcomCounter% Times Moved %MoveCounter% Import Files Moved %CredCounter% Credit Files Since %StartDate% %StartTime%
Wait>1
Goto>SleepChk
Goto>BeginMove
Last edited by ncentech on Mon Oct 18, 2004 3:03 pm, edited 1 time in total.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Thu Oct 07, 2004 2:43 am

Haven't looked at all of script yet, but you need to add "\" to PathFrom

The RED line will fail every time.
Label>BeginMove

'Gets the sleeptime from the Ini file
ReadIniFile>%EcomIni%,Settings,CycleTime,SleepTime

IfFileExists>%PathFrom%file.ref,Connected
Goto>DisConnect
And looking at Label>DisConnect it appears that you may be in a loop for %MaxTry% attempts.

Change From:
Let>PathFrom=t:
Change To:
Let>PathFrom=t:\
=============================
I usually do not include "\" in my Path variables. I prefer to include the "\" each time needed in the following scripts, because it makes it visually easier to read with the "\" there as a separator. But this is personal work habit. You should always "use your favorite method" when there are multiple "correct" solutions.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri Oct 08, 2004 3:21 pm

Hi ncentech,

How's your latest progress. Have you followed up Bob's advice?
Please let us know if we could help you further.

ncentech
Newbie
Posts: 7
Joined: Tue Oct 05, 2004 7:22 pm

Yes I have but it still fails

Post by ncentech » Sat Oct 09, 2004 1:40 am

It looks like after it has nothing to move or process it starts looking for more files to move or process and if there is nothing in the directories ms keeps looking and it locks up and quits after a while. I then have to start ms again.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Oct 09, 2004 3:34 am

Just a few questions.

1. Did you make the change(s) to add the missing "\" characters as I pointed out a few days ago?
If Yes, do you now get different symptoms? If YES, what are they? If NO, go to step 2.
If NO, you did not add the backslashes, please do that first. Then return to step 1 again.

2. Since making those changes results in no difference in symptoms, I would ask if you have looked at a log to see where it is getting hung up? If no log exists, then create one using the macro's properties. Provide copy of log here for last time it ran if you cannot make sense of what is happening. While waiting for forum response, go to Step 3.

3. If you cannot see the problem from the log, then, have you tried to single step through the macro, looking at the values of the variables in the Watch List?

Doing steps 1,2,3 in that sequence should help to focus in on the actual code that is causing your problem, IF in fact it is a coding problem.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

ncentech
Newbie
Posts: 7
Joined: Tue Oct 05, 2004 7:22 pm

Post by ncentech » Mon Oct 18, 2004 2:56 pm

Here is where it's getting hung according to the log file

Label>EndMove
GetTime>TIME
MidStr>TIME,1,2,HH
MidStr>TIME,10,11,AMPM
ConCat>TIME_MIN,AMPM
If>AMPM=AM,SleepChk
IF>HH=12,SleepChk
If>HH>08,END

Do you think it has to do with scheduling, take in cosideration that I am using version 7.2.034,

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Oct 18, 2004 4:18 pm

A few observations:

No where in your script (looking at earlier submission) do you calculate TIME_MIN.

So this line will give wrong results:
ConCat>TIME_MIN,AMPM

Don't know if that is a problem. Script should not hang here because of that, it will just stuff in %TIME_MIN% and continue.
------------------------------------------
Also did not see a label for END
------------------------------------------
Can you provide that section of the log where you say it is failing?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts