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?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.