Desktop productivity for business analysts and programmers

Strange bug with week prompts

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

Strange bug with week prompts

Hi all,

 

I am hitting a slight bug with prompts in Enterprise guide 7.11 HF3 (7.100.1.2805).

 

I have built a reporting process for our users in EG where they select a week to report on in a prompt.

The prompt is built as shown in the image below, as a date prompt where users enter a value with the date type set to week.

 Prompt.jpg

 

When the process using the prompt is run, enterprise guide sets some macro variables, prompt_1 and prompt_1_end as date9 format dates for the first and last date from the week selected.

 

The bug I am getting is that, generally the dates selected will be Mon-Sun for the week selected except for when week 1 of any year is selected where, the prompt examples show the correct dates but the actual values are Thu-Wed.

This behaviour seems to be true for most years not just 2016.

 

e.g.

Week53 2015 = 28DEC2015 - 03JAN2016

Week01 2016 = 07JAN2016 - 13JAN2016 (should be 04JAN2016-10JAN2016)

Week02 2016 = 11JAN2016 - 17JAN2016

 

Screen shots of prompt selecting and log after running:

Prompt2.jpg

Prompt3.jpg

 

 

Has anyone else come across this or found a solution?

Obviously it won't be difficult to change my process to select a single date and then calculate the week required myself but if i can just fix EG it will probably be less work...

 

Tim


Accepted Solutions
Solution
‎02-01-2016 04:00 AM
Contributor
Posts: 45

Re: Strange bug with week prompts

Response back from SAS support is that they are going to be raising it with R&D to consider a hotfix.

 

For the time being I have changed our reporting to use a normal date prompt and then am calculating the appropriate week values and label from that with the code below in case anyone else comes across this.

 

%let g_date_prompt_start = %sysfunc(intnx(week1.2,%sysfunc(inputn(&g_date_prompt,date9.),8.),0,B),date9.);
%let g_date_prompt_end   = %sysfunc(intnx(week1.2,%sysfunc(inputn(&g_date_prompt,date9.),8.),0,E),date9.);
%let g_date_prompt_label = %sysfunc(tranwrd(%sysfunc(scan(%sysfunc(inputn(&g_date_prompt,date9.),weekv11.),2,-)),W,Week )) %sysfunc(scan(%sysfunc(inputn(&g_date_prompt,date9.),weekv11.),1,-));

View solution in original post


All Replies
Esteemed Advisor
Posts: 6,693

Re: Strange bug with week prompts

[ Edited ]

Wow. Looks like you discovered a bug. Happens here with EG 4.3 and 6.1, SAS 9.2 (AIX) as backend.

This is a case for SAS TS, IMO.

 

Edit: the funny thing about this is that, while selecting the week and before hitting run, the correct dates are displayed.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 45

Re: Strange bug with week prompts

Have raised with SAS TS as well, will post back if i hear anything from them.

 

Added excitement is that the same thing happens if I am running a stored process in enterprise guide, but not if i run it in the stored process web app.

Esteemed Advisor
Posts: 6,693

Re: Strange bug with week prompts

This seems to isolate EG as the culprit. Please keep us informed on further developments.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Solution
‎02-01-2016 04:00 AM
Contributor
Posts: 45

Re: Strange bug with week prompts

Response back from SAS support is that they are going to be raising it with R&D to consider a hotfix.

 

For the time being I have changed our reporting to use a normal date prompt and then am calculating the appropriate week values and label from that with the code below in case anyone else comes across this.

 

%let g_date_prompt_start = %sysfunc(intnx(week1.2,%sysfunc(inputn(&g_date_prompt,date9.),8.),0,B),date9.);
%let g_date_prompt_end   = %sysfunc(intnx(week1.2,%sysfunc(inputn(&g_date_prompt,date9.),8.),0,E),date9.);
%let g_date_prompt_label = %sysfunc(tranwrd(%sysfunc(scan(%sysfunc(inputn(&g_date_prompt,date9.),weekv11.),2,-)),W,Week )) %sysfunc(scan(%sysfunc(inputn(&g_date_prompt,date9.),weekv11.),1,-));
Esteemed Advisor
Posts: 6,693

Re: Strange bug with week prompts

Congrats!

Now you have a real SAS bug to your name.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 307 views
  • 2 likes
  • 2 in conversation