Hello,
I was hoping someone would be able to help me figure out how to create a prompt that is a string. In one of the tables I use the date is fromatted as a string and is always in the following format YYYY-MM-DD. I would like to creat prompts so I do not have to go itno each query and change the filter. When I tried creating the prompt for the date field and it doesn't seem to work.
Does anyone know how to make this work?
Thanks!
It doesn't hurt to mention which version of EG you are using as options may vary.
Describe in some detail how you created the prompt for the date and what symptoms that "it doesn't seem to work".
Can you echo the value of the prompt and does it look correct?
Did you try to make it a SAS date value? If the dates in your data are string then any comparisons with SAS date values will likely fail.
Or vice versa, if your prompt is a string of that format and your SAS data has date values there isn't any easy way to compare.
How are you using the prompt?
Try it:
1 - Create your prompt as a date type and variable name DateRef.
2 - Change your variable from string to sas date format using a %let command. %let DateRef = %sysevalf("&DateRef"d);
3 - Use your var &DateRef!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.