I am new to SAS programming, I have few question reagrding SAS. These questions may be not relevant or easy, but as I said before I have no clue about SAS. So, If any one can help me out it would be great.My questions are:
1. Can we run SAS Program from MS DOS command prompt. If yes, how?
I want to run SAS Program in my SSIS Package ( in SQL Server)...the best way i found is through the cmd shell, but I don't know the exact command that need to be used to execute it.
2. If we can run the SAS from cmd (MS-DOS)....can we pass parameters to it
My SAS program need some parameters to be sent while executing.....so is there a way to send parameters to my SAS and execute it in CMD (windows)
Thank you in advance, I really appreciate your help.
I'm not sure about running from SSIS, but SAS, in general, can be run from the command prompt. There is a section about it in the SAS Companion for Windows (look at batch execution).
I know that passing parameters to a batch SAS program has been discussed in these forums, but can't find it now. If you have a lot of them to pass, it might be easier to code them as %LET macro variables and store them in a text file to %INCLUDE into the SAS program.
The simplest method of passing parameter data is to use the SAS run-time execution parameter SYSPARM= and you will use either the SAS automatic macro variable &SYSPARM or you can use the SAS function SYSPARM() to retrieve and parse the (optionally supplied) SYSPARM value as needed for your SAS application program.
Another technique is to write your data-strings to a sequential file and then use the SAS DATA step (or other techniques) to input those data for your processing needs.
Thanx for the reply, It was very helpful to me. I figured out that we can ran SAS through SSIS through the batch job and as you said I will implement the passing parameter passing through the text file. But my concern over here is my parameters are dynamic they vary each time so I though in the batch command it self we can send the parameters, but text file will also work for me as I can overwrite each time the parameters that I'm going to send. Thank you very much.