Hello SAS community,
On Windows server, does anyone used a batch file .bat or PowerShell to start a SAS Flow under Schedule Manager?
I was trying to use File dependency to run bunch of jobs within a flow http://go.documentation.sas.com/?docsetId=scheduleug&docsetTarget=n143fd9raligavn1qapnwkhv35w7.htm&d... but for some reason don’t see this option Actions->Add File Event from SMC even with my SAS Admin account.
Using Query Builder I have created some tasks and loaded them into LASR, running the scheduler once from the query builder will create an entry under schedule manager and I added all of them into a flow to execute all of them via a File Dependency.
Is it is possible to write a .bat file that I can call with another external process to start the SAS Flow?
Much appreciated your comments and input
thanks
Thank you @LinusH for your info. No problem I can create a bat file but don't know the syntax of how to call the flow. Do you have any example or URL document that you can pass?
thanks again
I think I found what I was looking for and testing the concept at the moment. So when you create a job under SMC you can access the command SAS users to execute the SAS program. Basically just place this commend into a .bat file and when you run the .bat file it will run your job!
D:\SAS\SASConfig\VA\Lev1\SASAppVA\BatchServer\sasbatch.bat -log D:\SAS\SASConfig\VA\Lev1\Logs\vdb_MyQRY_1526417035704_vdb_MyQRY_1526417035704_#Y.#m.#d_#H.#M.#s.log -batch -noterminal -logparm "rollover=session" -sysin D:\SAS\SASConfig\VA\Lev1\SASAppVA\SASEnvironment\SASCode\Jobs\vdb_MyQRY_1526417035704.sas
I hope it works but this is what I was looking for.
thanks
This is just the default way for running a single program in batch mode. The sasbatch.bat (or sasbatch.sh on real operating systems) is specifically created for this and should be used, as it guarantees the same environment that you have in a workspace, stored process, OLAP server under the same SAS Application Server.
For me, a flow is different from a program, as I'd use the word for a sequence of programs.
Hi @Kurt_Bremser thank you for your comment. I am on a windows environment and what I want to do is to automate the Unload and Load LASR tables in our VA environment. After research and talking to a SAS consultant I was told the best way for what I want to do is to use Query Builder, create my query by adding my source table (SQL Server table in this case), save and run it once using the scheduler icon. This would create a job file which basically the code I posted above. Now I can place that code into a .bat file and call it, it should run the job which is unloading the LASR and then reloading it. Idea was to add all of the jobs code into a single .bat file. It almost works, when I look at the log file for that job I see an error.
ERROR: Unauthorized: Check username/password.
ERROR: Unable to connect to Metadata Server.
ERROR: Write access to member ENTLASR.TESTING_SERVICE_TYPE.DATA is denied.
NOTE: The SAS System stopped processing this step because of errors.
Thanks again
You may have to set metadata-related system options so that you get access to the metadata server.
Hi @Kurt_Bremser and @LinusH,
I have created a .bat file with all of my LASR tables and it works. For example a UnloadLoad.bat contains 10 statements for 10 tables like
D:\SAS\SASConfig\VA\Lev1\SASAppVA\BatchServer\sasbatch.bat -log D:\SAS\SASConfig\VA\Lev1\Logs\vdb_MyQRY_1526417035704_vdb_MyQRY_1526417035704_#Y.#m.#d_#H.#M.#s.log -batch -noterminal -logparm "rollover=session" -sysin D:\SAS\SASConfig\VA\Lev1\SASAppVA\SASEnvironment\SASCode\Jobs\vdb_MyQRY_1526417035704.sas
I can put all of these jobs into a flow and I now I am wondering it make is much easier if I be able to just somehow call my flow that contains these 10 jobs.
When you create a flow, does it create any kind of file that can be called by a program?
thanks again
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.