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  iWay Software Product Forum on Focal Point    DATEADD but in Focus Variable?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DATEADD but in Focus Variable?
 Login/Join
 
Gold member
posted
Hi, So i have been searching for a thread to help me out but i believe the code i'm finding works in Dialogue Manager but not in focus code when creating a variable via a procedure?

What i'm trying to do is get the max date of a column from a table and substract 1 month. i have it corrected pulling the latest date however i can't seem to get it to substract 1 month?

Here is my code so far:

-SET &DDDATE=;

DEFINE FILE DAD
WRKD/A8YYMD=Discharge_Date;
WRKDA/A10=EDIT(WRKD,'9999/99/99');
-*WRKDAY=DATEADD(WRKDA,'M', -7); <- I believe this is the correct place to take the date which i have captured and just go back 1 month?
END


TABLE FILE DAD
SUM MAX.WRKDA
ON TABLE HOLD AS WD FORMAT ALPHA
END
-RUN

-READ WD &DDDATE.A10.

-RUN

-SET &&DDDATE='&DDDATE.EVAL';
&&DDDATE

Any help would be greatly appreciated thank you!


WebFocus 8.02, SQL Server 2008r2
 
Posts: 51 | Registered: November 30, 2012Report This Post
Expert
posted Hide Post
What is the format of Discharge_Date ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Platinum Member
posted Hide Post
Hi,

As per the WebFOCUS "Using Functions" manual:
quote:

DATEADD requires a date to be in date format. Since Dialogue Manager interprets a date as alphanumeric or numeric, and DATEADD requires a standard date stored as an offset from the base date, do not use DATEADD with Dialogue Manager unless you first convert the variable used as the input date to an offset from the base date.


So, as per the example:
TABLE FILE EMPLOYEE
PRINT FIRST_NAME HIRE_DATE 
COMPUTE NEW_DATE/YYMD = HIRE_DATE;
COMPUTE HIRE_DATE_PLUS_THREE/YYMD = DATEADD(NEW_DATE, 'WD', 3);
BY LAST_NAME
END


Your "in" date needs to be e.g. YYMD format.
And the "out" date (WRKDAY) needs a format.

So, if Discharge_Date is already a YYMD format, you probably need something like this:

  WRKDAY/YYMD=DATEADD(Discharge_Date,'M', -7); 


WebFOCUS 8.2.06 mostly Windows Server
 
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008Report This Post
Platinum Member
posted Hide Post
Use AYMD() for &VARs (Dialogue Manager)

  
-SET &DAY15 = AYMD(&YYMD, -15, 'I8');


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Master
posted Hide Post
Need to use DATEADD, DATEMOV and DATEDIF in Dialogue Manager?

Use DEFINE FUNCTION

Check out my post here:

Using DATE Functions in DM


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Gold member
posted Hide Post
quote:
Discharge

Hi Waz,

Discharge date is in 'YYYY-MM-DD'

thank you guys the only thing is Dialogue manager (in webfocus) is not the same as a procedure (in data migrator? uses focus langauge?) i'm trying to do this for a flow so i set a global variable so it can be used later on in the flow

example

where Discharge_Date = %%DDDATE

maybe i'm mixing the two up?


WebFocus 8.02, SQL Server 2008r2
 
Posts: 51 | Registered: November 30, 2012Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    DATEADD but in Focus Variable?

Copyright © 1996-2020 Information Builders