Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Unbalanced Parenthesis

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Unbalanced Parenthesis
 Login/Join
 
Member
posted
I would appreciate any assiistance with isolating 'unbalanced parenthesis' in the code below. I have reviewed this code a couple of times and cannot pinpoint line causing unbalanced parenthesis error. I need a 'fresh' set of eyes:

-SET &TWOWKS= DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D','-14'),
-'YYMD','I8YYMD');
-SET &FOURWKS= DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D','-28'),
-'YYMD','I8YYMD');
-SET &SIXWKS= DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D','-42'),
-'YYMD','I8YYMD');
-SET &EIGHTWKS= DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D','-56'),
-'YYMD','I8YYMD');
-SET &TENWKS= DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D','-70'),
-'YYMD','I8YYMD');
-*-SET &TWOWKS= DATECVT(DATEADD(DATECVT(20080224,'I8YYMD','YYMD'),'D','-14'),
-*-'YYMD','I8YYMD');
-*-SET &FOURWKS= DATECVT(DATEADD(DATECVT(20080224,'I8YYMD','YYMD'),'D','-28'),
-*-'YYMD','I8YYMD');
-*-SET &SIXWKS= DATECVT(DATEADD(DATECVT(20080224,'I8YYMD','YYMD'),'D','-42'),
-*-'YYMD','I8YYMD');
-*-SET &EIGHTWKS= DATECVT(DATEADD(DATECVT(20080224,'I8YYMD','YYMD'),'D','-56'),
-*-'YYMD','I8YYMD');
-*-SET &TENWKS= DATECVT(DATEADD(DATECVT(20080224,'I8YYMD','YYMD'),'D','-70'),
-*-'YYMD','I8YYMD');
-*-EXIT

This message has been edited. Last edited by: Kerry,


7.6.4 (being implemented 1/09)
Word, EXCEL EXL97, EXL2K, pdf, delimited, and many more
Operating system Windows
 
Posts: 4 | Registered: December 18, 2008Report This Post
Virtuoso
posted Hide Post
Try this way

SET &DAYS=DATECVT((DATEADD((DATECVT(&YYMD,'I8YYMD','YYMD')),'M', + 1 )-2),'YYMD','I8YYMD');


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
jjohnson,

I took your code and ran it in 713 and 764. Both ran ok, without any problem.

So I wonder if this is caused by something that might be present in your fex before this piece of code.

BTW: you should be able to have the statements on one line, like:
-SET &TWOWKS= DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D','-14'),'YYMD','I8YYMD');
  


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
I think your problem is due to the fact that the second line of the -SET statement needs a space between the - and the ':
  
-SET &TWOWKS= DATECVT(DATEADD(DATECVT(&YYMD,'I8YYMD','YYMD'),'D','-14'),
- 'YYMD','I8YYMD');


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
I don't see any unballanced parens either. But the DATEADD call looks wrong, on two counts. You've got
... DATEADD( DATECVT(&YYMD,'I8YYMD','YYMD'), 'D', '-14' ) ...

With
arg1 = result of inner DATECVT
arg2 = 'D' for Days
arg3 = '-14' as number of days

But (according to the syntax reqirements quoted below),

a. arg3 should be numeric (rather than character); remove the quotes
b. arg4, the ouput format for DATEADD, is needed (s/b 'YYMD', matching the trailing arg of the inner DATECVT call, snce that is DATEADD's input)

-- as sometimes happens, the parser caught an error, but triggered the wrong error-message number.



Syntax: How to Add or Subtract a Date Unit to or From a Date 

DATEADD(date, 'unit', #units, outfield)
 where: 

 date   Date           Is a full component date.

 unit   Alphanumeric   Is one of the following enclosed in single quotation marks:

  Y indicates a year unit.
  M indicates a month unit.
  D indicates a day unit.
  WD indicates a weekday unit. 
  BD indicates a business day unit. 

 #units   Integer      Is the number of date units added to or subtracted from date. If this number is not a whole unit, it is rounded down to the next largest integer.

 outfield   Date (numeric date offset)     Is the name of the field that contains the result, or the format of the output value enclosed in single quotation marks. 


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
Sorry for late response. I was out on vacation and turn this issue over to peer for resolution.

Thank you all for your help. I learned this has been resolved. Apprently, there was some bug and we had to download a patch for implementation, which corrected the issue with date fields.


7.6.4 (being implemented 1/09)
Word, EXCEL EXL97, EXL2K, pdf, delimited, and many more
Operating system Windows
 
Posts: 4 | Registered: December 18, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Unbalanced Parenthesis

Copyright © 1996-2020 Information Builders