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     [CLOSED] change date 2011/04/15 into 20110415

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] change date 2011/04/15 into 20110415
 Login/Join
 
Member
posted
Hi,

Problem is like the Subject tells: I need to change a date like 2011/04/15 into 20110415 in such a way that WebFOCUS understands it is a date field so I can join it to an other file en make where-statements on the date. Who knows what to do?

This is what I've got:
DEFINE FILE DBC_ANALYSE
DATUM/YYMD=CDATE(DBC_ANALYSE.DBC_ANALYSE.DBC_AFSLUITDAG);
END

TABLE FILE DBC_ANALYSE
etcetera

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


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 10 | Registered: November 16, 2010Report This Post
Expert
posted Hide Post
You have to be more specific - what is the format of the field containing the value like "2011/04/15"?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
And, what is "CDATE" - it's not a standard WebFOCUS Date function.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Martin

What is the fieldfomat in the original database?
What does the master field description say?




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Member
posted Hide Post
Original format is YYMD. When printed it's like 2011/04/15.

The field I'd like to join to has the format I8 (when printed it's like 20110415).

Is this the information you needed?


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 10 | Registered: November 16, 2010Report This Post
Expert
posted Hide Post
DEFINE FILE DBC_ANALYSE
DATUM/I8YYMD=DBC_AFSLUITDAG;
END


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
quote:
DEFINE FILE DBC_ANALYSE
DATUM/I8YYMD=DBC_AFSLUITDAG;
END


I've made a mistake: the format of the field DBC_Afsluitdag is A17... Your solution didn't work...


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 10 | Registered: November 16, 2010Report This Post
Member
posted Hide Post
CDATE IS A DATE CONVERSION WE USE BY A STANDARD FEX. iT'S LIKE:


DEFINE FUNCTION CDATE(D/A17)
DAGSTR/A2V = GETTOK(D, 17, 1, ' ', 2, 'A2');
DAG/A2 = IF EDIT(DAGSTR) LT 10 THEN '0'||DAGSTR ELSE DAGSTR;
MAANDSTR/A9 = GETTOK(D, 17, 2, ' ', 9, 'A9');
MAAND/A2 = DECODE MAANDSTR(
'Januari' '01'
'Februari' '02'
'Maart' '03'
'April' '04'
'Mei' '05'
'Juni' '06'
'Juli' '07'
'Augustus' '08'
'September' '09'
'Oktober' '10'
'November' '11'
'December' '12'
);
JAAR/A4=GETTOK(D, 17, 3, ' ', 4, 'A4');
DATUM/A8DMYY=DAG||MAAND||JAAR;
CDATE/DMYY=DATUM;
END

I AM NOT FAMILIAR WITH THIS DEFINE. ANYBODY ABLE TO EXPLAIN TO ME?


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 10 | Registered: November 16, 2010Report This Post
Expert
posted Hide Post
quote:

Original format is YYMD. When printed it's like 2011/04/15.


quote:

I've made a mistake: the format of the field DBC_Afsluitdag is A17... Your solution didn't work...


Of course it didn't work.

RTFM


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Member
posted Hide Post
Thanks for your constructive comments, It has helped me tremendously. Are you available for serious help or not? If not, please do not bother to reply..

Kind regards,

Martin


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 10 | Registered: November 16, 2010Report This Post
Master
posted Hide Post
Maybe I'm missing something here, but why not just use EDIT to:
a) Mask out the slashes, and simultaneously
b) Trim the result from 17 alpha characters down to the required 8.

Then it's a simple matter to convert to true YYMD.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Expert
posted Hide Post
Never available to people who don't read the manual, nor, to people who don't have a clue...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Martin,

You have to do some work too, we cannot help you if you are not precise in your questions. As Tom states, of course the solution did not work, since the solution is for a YYMD formatted date - as you stated.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Martin,

I am guessing that your mother tongue is german so -

Die DEFINE, die Sie erwähnen oben definiert eine Funktion aufzurufen. Dies ist im Grunde ein eigenständiges Stück Code, das Ihnen erlaubt die Eingabe eines oder mehrerer Datenelemente (in Ihrem Beispiel) mit einem Ausgang bereitzustellen. Es gibt ein paar Anforderungen innerhalb der Funktion und diese sind gut dokumentiert, aber es genügt zu sagen, dass die wichtigsten Anforderungen, die den Namen der Funktion (CDATE in Ihrem Fall die gleichen sein wie das Feld zurück (bestanden CDATE/DMYY = DATUM werden; ).

The DEFINE that you mention above defines a function call. This is basically a stand alone piece of code that allows you to input one or more data items (one in your example) to provide an output. There are a few requirements within the function and these are well documented, but suffice to say that the main requirements are that the function name (CDATE in your case must be the same as the field passed back (CDATE/DMYY = DATUM; ).

Ich wage eine Vermutung, dass diese Funktion wurde vor einer Weile als könnte man die gleiche Hilfe erreichen geschrieben einige Routinen, so dass Sie hart Codierung decodiert etc. vermeiden konnte gebaut: -

I would hazard a guess that that function was written a while ago as you could achieve the same using some built in routines so that you could avoid hard coding decodes etc. :-
DEFINE FILE CAR
  DBC_AFSLUITDAG/A17 = '1 Januari 2011';
  DATUMH/HYYMDs = HINPUT(17, DBC_AFSLUITDAG, 8, 'HYYMDs');
  DATUM/YYMD = HDATE(DATUMH, 'YYMD');
END

TABLE FILE CAR
PRINT DBC_AFSLUITDAG
      DATUM
      DATUMH
   BY COUNTRY
IF RECORDLIMIT EQ 1
END

Das, was man über WebFOCUS Termine erinnern ist, dass sie als eine Zählung der Tage seit dem Stichtag (31. Dezember 1970) und sie werden anders, wie sie so nicht nötig, "der Schrägstriche loszuwerden" gehalten werden angezeigt existieren.

The thing to remember about WebFOCUS dates is that they exist as a count of days since the base date (31 December 1970) and they will be displayed differently to how they are held so no need to "get rid of the slashes".

@Tom,

Folks try their best to write correct english but sometimes interpretation does present a rather abrupt and factual sounding output. I guess we should try and give them the benefit of the doubt although, as you know, I am one of the first (usually) to suggest a good session with the FOCUS manual. Wink

Folks versuchen ihr Bestes, um eine korrekte Englisch, aber manchmal Interpretation hat gegenwärtig eine ziemlich abrupt und sachlich klingenden Ausgang. Ich denke, wir sollten versuchen, und ihnen den Nutzen des Zweifels, obwohl, wie Sie wissen, ich einer der ersten bin (meistens) eine gute Sitzung mit dem FOCUS Handbuch vorschlagen. Razzer Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
not German Tony. dutch...




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
quote:
not German Tony. dutch...

Well ..... at least I tried Smiler

T
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
Martin,

De DEFINE die u hierboven vermeld definieert een functie aan te roepen. Dit is in principe een stand-alone stukje code dat je toelaat om input van een of meer data-items (een in uw voorbeeld) te voorzien in een uitgang. Er zijn een paar eisen binnen de functie en deze zijn goed gedocumenteerd, maar het volstaat te zeggen dat de belangrijkste vereisten zijn dat de functie naam (CDATE in uw geval moet dezelfde zijn als op het gebied doorgegeven (CDATE/DMYY = DATUM; ).

Ik zou gevaar een vermoeden dat die functie was een tijdje geleden geschreven zoals je zou het hetzelfde te bereiken met behulp van enkele ingebouwde routines, zodat je kon hard te coderen decodeert enz. te vermijden: -

DEFINE FILE CAR
  DBC_AFSLUITDAG/A17 = '1 Januari 2011';
  DATUMH/HYYMDs = HINPUT(17, DBC_AFSLUITDAG, 8, 'HYYMDs');
  DATUM/YYMD = HDATE(DATUMH, 'YYMD');
END

TABLE FILE CAR
PRINT DBC_AFSLUITDAG
      DATUM
      DATUMH
   BY COUNTRY
IF RECORDLIMIT EQ 1
END

Het ding om te onthouden over WebFocus data is dat ze bestaan ​​als een telling van de dagen sinds het referentiejaar datum (31 december 1970) en zij zullen anders worden weergegeven om hoe ze zijn dus geen noodzaak om "zich te ontdoen van de schuine strepen" gehouden.

T Roll Eyes Music


Mensen doen hun best om te schrijven correct Engels, maar soms uitlegging doet dit een nogal abrupte en feitelijke klinkende uitgang. Ik denk dat we moeten proberen hen te geven het voordeel van de twijfel, hoewel, zoals u weet, ik ben een van de eerste (meestal) om een goede sessie stellen met de FOCUS handleiding.



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
All,

This is an English forum. Please do not use some automatic translation device to create something that looks like Dutch or German with English grammar and/or English typical expressions.

When I'm reading it I translate each word individually from Dutch/German to English trying to figure out what the original English sentence was. And -then- translate it's meaning back to Dutch.



Oh, and Martin...

Here you go:
 
DEFINE FILE CAR
	DUMMYDATE/YYMD = &YYMD;

	MYDATE/I8 = ( DATECVT(DUMMYDATE, 'YYMD', 'YY') * 10000 ) + ( DATECVT(DUMMYDATE, 'YYMD', 'M') * 100 ) + DATECVT(DUMMYDATE, 'YYMD', 'D')
END

TABLE FILE CAR
	SUM SALES
	BY DUMMYDATE
	BY MYDATE
END


First I make a DUMMYDATE with a date in YYMD format ( displayed as yyyy/mm/dd )

Then I take the year part:
DATECVT(DUMMYDATE, 'YYMD', 'YY')

The month part:
DATECVT(DUMMYDATE, 'YYMD', 'M')

The day part:
DATECVT(DUMMYDATE, 'YYMD', 'D')

MYDATE/I8 = ( Year * 10000 ) + ( Month * 100 ) + Day

G'luck.
Greets,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
Martin

you may consider buying the book "(Almost) 1001 ways to work with dates in webfocus" isbn 978-0-9791722-1-2 only 25 dollar it was and worth all the money.

succes




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Member
posted Hide Post
Thanks Dave, FrankDutch and Tony A and initially Tom Flynn for your help!


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 10 | Registered: November 16, 2010Report 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     [CLOSED] change date 2011/04/15 into 20110415

Copyright © 1996-2020 Information Builders