Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Running multiple SAS jobs using VB

I have the following code which opens and runs a couple of SAS jobs. The
problem is it submits the SAS jobs one after the other without waiting for
the first to complete. This means a message box appears in SAS that says:

Note: is currently executing. All subsewuently submitted statements will not
begin executing until its completion.

What I need VB to do is wait until the first job has finished and then
submit the second. I could make VB wait for a defined length of time but due
to server speeds it is hard to say how long that will take. I don't want to
make it a long time as that will defeat the purpose of automating it.

Is there a way to let VB know when the first job has completed? Code below:

Sub macro1()

Dim OleSAS As Object

Set OleSAS = CreateObject("SAS.Application")

OleSAS.Visible = True

ExePath = "%include
'\\Appsl2021\RISKDATA2\Reporting\AutoExec\Reportin gAutoExec.sas';"
OleSAS.submit (ExePath)

ExePath = "%include '\\Appsl2021\RISKDATA2\Reporting\Programs\Daily
Production\005. Daily Recoveries Analysis\Daily Jobs - Wasis Checks\PL New
Daily Wasis.sas';"
OleSAS.submit (ExePath)

ExePath = "%include '\\Appsl2021\RISKDATA2\Reporting\Programs\Daily
Production\005. Daily Recoveries Analysis\Daily Jobs - Wasis Checks\PL New
Daily Colls Wasis.sas;"
OleSAS.submit (ExePath)

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Running multiple SAS jobs using VB

Have you tried using the SAS "wait" command ?

http://www.google.com/search?source=...q=sas+ole+wait

Tim



"fullers" wrote in message
...
I have the following code which opens and runs a couple of SAS jobs. The
problem is it submits the SAS jobs one after the other without waiting for
the first to complete. This means a message box appears in SAS that says:

Note: is currently executing. All subsewuently submitted statements will
not
begin executing until its completion.

What I need VB to do is wait until the first job has finished and then
submit the second. I could make VB wait for a defined length of time but
due
to server speeds it is hard to say how long that will take. I don't want
to
make it a long time as that will defeat the purpose of automating it.

Is there a way to let VB know when the first job has completed? Code
below:

Sub macro1()

Dim OleSAS As Object

Set OleSAS = CreateObject("SAS.Application")

OleSAS.Visible = True

ExePath = "%include
'\\Appsl2021\RISKDATA2\Reporting\AutoExec\Reportin gAutoExec.sas';"
OleSAS.submit (ExePath)

ExePath = "%include '\\Appsl2021\RISKDATA2\Reporting\Programs\Daily
Production\005. Daily Recoveries Analysis\Daily Jobs - Wasis Checks\PL New
Daily Wasis.sas';"
OleSAS.submit (ExePath)

ExePath = "%include '\\Appsl2021\RISKDATA2\Reporting\Programs\Daily
Production\005. Daily Recoveries Analysis\Daily Jobs - Wasis Checks\PL New
Daily Colls Wasis.sas;"
OleSAS.submit (ExePath)

End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
jobs Eddie McHale Excel Worksheet Functions 2 July 23rd 07 10:02 PM
More trusted jobs here palanivel Excel Programming 0 March 28th 07 07:55 AM
Need help on my Jobs applied too SS John the Baptist Jr. Excel Discussion (Misc queries) 1 August 31st 06 12:06 AM
Need help on my Jobs applied too SS John the Baptist Jr. Excel Programming 1 August 31st 06 12:06 AM
print jobs History of print jobs Excel Discussion (Misc queries) 3 June 16th 06 06:11 AM


All times are GMT +1. The time now is 03:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"