Desktop productivity for business analysts and programmers

creating a prompt using a string

Reply
New Contributor
Posts: 3

creating a prompt using a string

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! 

Grand Advisor
Posts: 10,210

Re: creating a prompt using a string

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?

New Contributor
Posts: 2

Re: creating a prompt using a string

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!

Ask a Question
Discussion stats
  • 2 replies
  • 165 views
  • 0 likes
  • 3 in conversation