I have some .sas file that is run from a .bat file as such:
@echo off # Run the SAS code start sas "C:\file\to\code\runME.sas"
The SAS program creates a PDF report, and I want the user to be able to define the time period the report is for. Is there anyway I can require the command window (or anything trigger by running the .bat file), to ask for a start and end date, that is then passed to SAS to report on the date range?
@MB_Analyst wrote:
Is there anyway I can require the command window (or anything trigger by running the .bat file), to ask for a start and end date, that is then passed to SAS to report on the date range?
Yes, there are ways to do this.
I'd use the bat script to ask for the parameters though, because that's really easy, and then pass them to the program to be used as parameters or macro variables in the START command.
@MB_Analyst wrote:
Is there anyway I can require the command window (or anything trigger by running the .bat file), to ask for a start and end date, that is then passed to SAS to report on the date range?
Yes, there are ways to do this.
I'd use the bat script to ask for the parameters though, because that's really easy, and then pass them to the program to be used as parameters or macro variables in the START command.
Is this question doing what I require? And I get the .bat file to prompt for the parameters?
It's how you would do the second step, pass the parameters to your code.
@MB_Analyst wrote:
Is this question doing what I require? And I get the .bat file to prompt for the parameters?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.