BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MB_Analyst
Obsidian | Level 7

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

@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. 

 

 

View solution in original post

3 REPLIES 3
Reeza
Super User

@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
Obsidian | Level 7

Is this question doing what I require? And I get the .bat file to prompt for the parameters?

Reeza
Super User

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?


 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1372 views
  • 2 likes
  • 2 in conversation