DATA Step, Macro, Functions and more

Batch execution from context menu

Reply
Contributor
Posts: 60

Batch execution from context menu

Hi,

I need a solution for executing SAS programs in the batch. Let me explain the exact solution.

I have 20 programs in the Windows explorer. I want to execute 5 selected programs with right click context Menu "Batch submit in SAS 9.1" action and also i want to check the Logs of the those executed 5 programs.

But the problem is, it is executing each program in each session(concurrently) and also i dont know how to call my logcheck macro for the selected sas file logs.

Hope this understands my situation. Please help me to solve this issue.

Thanks
Sudhakar
Super Contributor
Super Contributor
Posts: 3,174

Re: Batch execution from context menu

Posted in reply to Sudhakar_A
You will need to explain the purpose and processing logic for the "logcheck" macro you mentioned? Include information about your SAS version, as well -- it makes a difference.

Scott Barry
SBBWorks, Inc.

SAS Companion for Windows - Submitting SAS Code
http://support.sas.com/documentation/cdl/en/hostwin/61924/HTML/default/a000104288.htm#a003202824
Contributor
Posts: 60

Re: Batch execution from context menu

Logcheck is the macro which will check the "Errors", "Warnings" in the SAS Log file.

My sas version is SAS 9.1
Super Contributor
Super Contributor
Posts: 3,174

Re: Batch execution from context menu

Posted in reply to Sudhakar_A
We need more information about the macro - without seeing the code (paste it in your reply), it's not going to be easy to help you find a solution to your problem.

Scott Barry
SBBWorks, Inc.
Super Contributor
Super Contributor
Posts: 3,174

Re: Batch execution from context menu

Explore using SAS system option ALTLOG= (at invocation time) and also consider using PROC PRINTTO with LOG=. Refer to the SAS DOC references provided in this thread for details.

Here is a Google advanced search argument which yields matches against the SAS.COM SAS support http://support.sas.com/ website:

routing log output batch site:sas.com


Scott Barry
SBBWorks, Inc.

Managing SAS Output under Windows
Routing Procedure Output and the SAS Log to a File
http://support.sas.com/documentation/cdl/en/hostwin/61924/HTML/default/procoutput.htm

ALTLOG System Option: Windows
http://support.sas.com/documentation/cdl/en/hostwin/61924/HTML/default/win-sysop-altlog.htm
Contributor
Posts: 60

Re: Batch execution from context menu

Hi Scott,

I think you didn't understand my question, let me tell you correctly.

Try from your system.

1. Select more than one sas program in the windows explorer and then right click on it you can see "Batch Submit with SAS 9.1" click on it you can see selected programs are executing in batch concurrently. I want this to be executed one by one sequentially. this is my first question.

2. In addition to the above one i need to check the log files created by this sas programs after the program execution

Hope this explains you my problem. Please help me solve this problem.

Thanks
Sudhakar
Valued Guide
Posts: 2,177

Re: Batch execution from context menu

Posted in reply to Sudhakar_A
when you have several SAS programs selected, and want SAS to run these in batch, how would you indicate the order in which they should run?
Would it be possible to create a separate SAS program which contains

option nosyntaxcheck source2 ;
%include {name of first program} ;
%include {name of next program} ;
%include {name of next program} ;
%include {name of next program} ;
%include {name of next program} ;


Then just start this program.
You will have just one SAS log to analyse, and hopefully all your programs are properly tested and will contain no syntax errors, only data errors.

There are alternatives.

good luck

PeterC
Super Contributor
Super Contributor
Posts: 3,174

Re: Batch execution from context menu

Suggest reviewing the SAS Companion for Windows - it mentions the ability to drag selected file(s) into an active SAS session's LOG window and SAS will then prompt you to "Submit". Unfortunately, you will not get your individual program's SAS log created in a separate file for each program, as it occurs when executing SAS batch requests.

Regarding your "log check" macro - you can explore using PROC PRINTTO and also the ALTLOG= OPTIONS parameter to re-direct your SAS log output to a file for whatever parsing and validating you want.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 7 replies
  • 264 views
  • 0 likes
  • 3 in conversation