08-16-2016 09:45 AM
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?
08-16-2016 11:42 AM
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?
08-16-2016 03:21 PM
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!