BookmarkSubscribeRSS Feed
jakubniescior
Fluorite | Level 6

Hi,

I'm using SAS VA 7.4 and I have access to SAS Studio.

 

I am trying to find a way to automatically schedule queries in SAS VA.

 

The solution must be smart enough to not run some queries if other queries failed.

The only solution I have is to schedule jobs manually or write programs in sas studio, and then

 set proper settings manually in management console.

This whole process seems to me like manual work-around, but I don't have too much experience nor knowledge

 to think otherwise.

 

My question is if there is any method to automatically schedule queries in sas va, so they would be dependent on each other

 (for example if one query fails, then others will not run or I will get some information in system)

 

Thank you.

4 REPLIES 4
AndrewHowell
Moderator

Queries created in the Visual Analytics Data Builder query can be run on demand, or scheduled to run at a preferred time.

 

You can use the Visual Analytics Data Builder to create queries and/or tailor the processing with some pre/postcode and/or completely replace the generated code with user-written code.

 

Multi-query dependencies - not sure if/how VA would handle that (unless they were all part of a single user-written query).

 

Hope that helps.

jakubniescior
Fluorite | Level 6

Thank you for your reply Andrew,

 

From what I found, the SAS VA is limited in case of scheduling. It does not have advanced scheduling options in itself.

That is why I 

 

I hope there exists some solution (even scripting in other tools having only SAS VA licence, like SAS Studio, VBS), which enables to create schedules with query dependencies

DrTwoLittle
Fluorite | Level 6

I have found a solution to this by using a SQL job that I can put conditions on. SAS allows you to refresh data using a command line. This give you a large amount of flexibility in scheduling.

 

A person can use a batch file with just the command

cmd.exe /c C:\SAS\Config\Lev1\SASApp\BatchServer\sasbatch.bat -log C:\SAS\Config\Lev1\SASApp\BatchServer\Logs\vdb_JOBNAME_#Y.#m.#d_#H.#M.#s.log  -batch -noterminal -logparm "rollover=session"  -sysin C:\SAS\Config\Lev1\SASApp\SASEnvironment\SASCode\Jobs\vdb_JOBNAME.sas

 

If you want to create the SQL Job, use this script.

Function New-RemoteProcess {
    Param([string]$computername=$env:computername,
        [string]$cmd
    )
    $ErrorActionPreference="SilentlyContinue"
    Trap {
        Continue
    }   
    [wmiclass]$wmi="\\$computername\root\cimv2:win32_process"
    #bail out if the object didn't get created
    if (!$wmi) {return}
    $remote=$wmi.Create($cmd)
}

New-RemoteProcess -comp "SASSERVER" -cmd 'cmd.exe /c C:\SAS\Config\Lev1\SASApp\BatchServer\sasbatch.bat -log C:\SAS\Config\Lev1\SASApp\BatchServer\Logs\vdb_JOBNAME_#Y.#m.#d_#H.#M.#s.log  -batch -noterminal -logparm "rollover=session"  -sysin C:\SAS\Config\Lev1\SASApp\SASEnvironment\SASCode\Jobs\vdb_JOBNAME.sas'

jakubniescior
Fluorite | Level 6

Thank you DrTwoLittle for your answer.

I like it, but it still does not answer to my problem.

How I understand your solution, is that it just creates the job.

The problem is where I want to create scheduled jobs relationships.

The scheduled jobs are meant to run by itself when the scheduler want it, and I want to automatically create scheduled dependencies

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2015 views
  • 4 likes
  • 3 in conversation