Focal Point
[CLOSED] UnBalanced Paraentheses (FOC262) while CASTING as DATE

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/2597083776

July 22, 2015, 02:32 PM
najam
[CLOSED] UnBalanced Paraentheses (FOC262) while CASTING as DATE
for the following code I got the error (FOC262) UNBALANCED PARENTHESES and these two lines utilizing in Focus Procedure

-SET &&HISTORICAL_MTH_END_DT= AYMD(&Contant_Value, -1, 'I8YYMD');

-SET &&HISTORICAL_MTH_END_DT_C = CAST(EDIT('&&HISTORICAL_MTH_END_DT','9999/99/99') AS DATE);

Any Clue ? for the missing parantheses

here is the Full Code for Focus Procedure

-SET &ECHO=ALL;

-SET &Contant_Value = '20150101';
-SET &&HISTORICAL_MTH_END_DT= AYMD(&Contant_Value, -1, 'I8YYMD');
-SET &&HISTORICAL_MTH_END_DT_C = CAST(EDIT('&&HISTORICAL_MTH_END_DT','9999/99/99') As DATE );
-TYPE &&HISTORICAL_MTH_END_DT
-RUN

This message has been edited. Last edited by: <Kathryn Henning>,


iWay
July 22, 2015, 05:44 PM
Dan Satchell
I'm not sure you can use DB expressions in Dialogue Manager. I would be inclined to use them in a DEFINE associated with a relational table. In any case, you might try using the DB_EXPR function:

DB_EXPR(CAST(EDIT('&&HISTORICAL_MTH_END_DT','9999/99/99') AS DATE));



WebFOCUS 7.7.05
July 24, 2015, 02:38 PM
najam
The suggested proposal would not work


iWay
July 27, 2015, 01:37 AM
StuBouyer
You are probably going to have to do it in 3 lines.

Also you probably need to have the final line in quotes otherwise Dialoge Manager will treat CAST and DATE as DM functions.

Try

-SET &&HISTORICAL_MTH_END_DT= AYMD(&Contant_Value, -1, 'I8YYMD');
-SET &&HISTORICAL_MTH_END_DT_A = EDIT('&&HISTORICAL_MTH_END_DT','9999/99/99');
-SET &&HISTORICAL_MTH_END_DT_C = 'CAST( &&HISTORICAL_MTH_END_DT_A AS DATE)';

You may need to change the thirdline to be

-SET &&HISTORICAL_MTH_END_DT_C = 'CAST( &&HISTORICAL_MTH_END_DT_A.EVAL AS DATE)';

OR

-SET &&HISTORICAL_MTH_END_DT_C = 'CAST( &&HISTORICAL_MTH_END_DT_A.QUOTEDSTRING AS DATE)';

depending on your SQL variant.

Cheers

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)
July 27, 2015, 03:06 PM
John_Edwards
What do these resolve to when they're expanded at runtime? Are there ever parens or quotes in the amper-variables that could gum up the works?