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] Problem in comparing Greg date with I8 variable

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Problem in comparing Greg date with I8 variable
 Login/Join
 
Member
posted
Hello,

I am new to this forum.I use FOCUS 7.0.8R on ZOS 390 Mainframes to create reports.I am facing the below problem.
I need to accept current date
and then compare with gregorian date but the if condition to check is failing.
Details are below :
The following code is used to convert date into Greg date
GREGT/I8=GREGDT(LNDTENTERD,GREGT);
and I am accepting current date in A10 format which comes as CCYY/MM/DD , which then I convert to I8.
The following condition always fail when I pass FMT dates as Alphanumeric OR as I8 tried both ways.
IF GREGT GE STR-DATE
IF GREGT LE END_DATE
but this condition works fine when I pass hard coded value for example
IF GREGT GE 20100301
IF GREGT LE 20100331
I tried displaying GREGT in spool values comes as 40200635 , dont know the reason.Please help me.
I need to accept current date , based on which I calculate STR_DATE and END_DATE and then need to compare with GREGT , I cannot hard code years.

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


FOCUS for mainframes FOCUS 7.0.8R
Z/OS 390 Mainframes
basic mainframe output only, either direct it to SPOOL or create .txt formats
 
Posts: 2 | Registered: April 29, 2010Report This Post
Virtuoso
posted Hide Post
Do you receive an error message? Can you also show us the code for converting the current date into start date and end date?

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
quote:
40200635

This value it look like summed I8 date value, yes? 20100304 + 20100331 maybe, no?

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 106 | Registered: April 06, 2009Report This Post
Platinum Member
posted Hide Post
For date compare no use I8 but use WF date (I8YYMD or YYMD) then you see real internal date compare and not compare of numbers -

-SET &DT_BEG = DATECVT(DATEMOV(DATECVT(&YYMD,'I8YYMD','YYMD'),'BOM'),'YYMD','I8YYMD');
-SET &DT_END = DATECVT(DATEMOV(DATECVT(&YYMD,'I8YYMD','YYMD'),'EOM'),'YYMD','I8YYMD');

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 106 | Registered: April 06, 2009Report This Post
Member
posted Hide Post
Thank you all for replying to my query.
My apologies for writing a LONG mail , as I want to be descriptive in explanation.

What I am really interested to know here is why the date is getting displayed as 40200635 when I display it in greg format i.e. I8 but same field if I convert to A8 and display it gives 20100326.(26 March2010)
What I have done is I have converted my FMT dates as mentioned in last mail to I8 gregformat by first converting it to Julian and then passing julian to Greg.Conversion happens fine , but to my surprise again the date is displayed as 40200xxx where xxx is a number forgot to save last time.
Even though when I compare this greg date with GREGT date I get following error
(FOC006) THE FORMAT OF THE TEST VALUE IS INCONSISTENT WITH FIELD FORMAT:
My requirement is simple
a.) accept the current date
b.) based on which find first day and last day of previous month
c.) Then compare with GREGT ( I Cannot change this value) as follows
IF GREGT GE STR-DATE
IF GREGT LE END_DATE
where STR_DATE and END_DATE should be first day and last day of month in format ccyymmdd.
GREGT is derived as follows
GREGT/I8=GREGDT(LNDTENTERD,GREGT);

I will try with Kofi reply and see if it works.


FOCUS for mainframes FOCUS 7.0.8R
Z/OS 390 Mainframes
basic mainframe output only, either direct it to SPOOL or create .txt formats
 
Posts: 2 | Registered: April 29, 2010Report This Post
Expert
posted Hide Post
This is just a guess because your format matches the documentation. Try format I8YYMD instead of just I8.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
I had to set DEFCENT in order to get GREGDT to produce 2010/05/05 instead of 1910/05/05.

SET DEFCENT = 20
-*
DEFINE FILE CAR
 CURRDATE/I8 WITH COUNTRY = &YYMD ;
 JULDATE/I5    = JULDAT(CURRDATE,'I5');
 GREGDT/YYMD   = GREGDT(JULDATE,'I8YYMD');
 BEG_MTH/YYMD  = DATEMOV('&YYMD','BOM');
 END_DATE/YYMD = DATEADD(BEG_MTH,'D',-1); 
 STR_DATE/YYMD = DATEMOV(END_DATE,'BOM');
END
-*
TABLE FILE CAR
 PRINT CURRDATE JULDATE GREGDT BEG_MTH STR_DATE END_DATE 
 WHERE RECORDLIMIT EQ 1 ;
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
No need for DEFCENT:

APP APPENDPATH IBISAMP
-RUN
DEFINE FILE CAR
XCURRDATE/I8YYMD WITH COUNTRY = &YYMD ;
CURRDATE/YYMD = XCURRDATE;
XJULDATE/I7 = JULDAT(XCURRDATE,'I7');
XGREGDT/YYMD = GREGDT(XJULDATE,'I8YYMD');
BEG_MTH/YYMD = DATEMOV('&YYMD','BOM');
END_DATE/YYMD = DATEADD(BEG_MTH,'D',-1);
STR_DATE/YYMD = DATEMOV(END_DATE,'BOM');
END
-*
TABLE FILE CAR
PRINT CURRDATE XJULDATE XGREGDT BEG_MTH STR_DATE END_DATE
WHERE RECORDLIMIT EQ 1 ;
END

-EXIT

  

CURRDATE    XJULDATE   XGREGDT    BEG_MTH    STR_DATE   END_DATE 
2010/05/05  2010125    2010/05/05 2010/05/01 2010/04/01 2010/04/30 



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report 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] Problem in comparing Greg date with I8 variable

Copyright © 1996-2020 Information Builders