View previous topic :: View next topic
|
Author |
Message |
srini_igsi Currently Banned New User
Joined: 09 Dec 2005 Posts: 30 Location: Pune
|
|
|
|
SELECT *
FROM DBAX1.TCDHXX_MED_CLM_DET
WHERE INTEG_PART_ID = '00XXX'
AND BENEFIT_START_DT <= CURRENT DATE
AND (BENEFIT_END_DT + 90 DAYS) >= CURRENT DATE ;
Is there a way to simmulate the start and end date check above using Cobol?
This is because Benefit start and end dates are coming in the copybook in YYYYMMDD format.
Should I have a separate date validation routine for this check? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Intrinsic functions?
Something like
if FUNCTION INTEGER-OF-DATE(BENEFIT_START_DT) le INTEGER-OF-DATE(CURRENT DATE) and
FUNCTION INTEGER-OF-DATE(BENEFIT_END_DT) + 90 ge INTEGER-OF-DATE(CURRENT DATE) |
|
Back to top |
|
|
srini_igsi Currently Banned New User
Joined: 09 Dec 2005 Posts: 30 Location: Pune
|
|
|
|
Thanks William. I am just looking out for this kind of logic only. Hope this would work. Let me give a try and get back. |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
You can do that query straight away in COBOL. The CURRENT_DATE is a DB2 keyword and it should work fine in your query. If you want to use your date from a copybook you need to convert it to a DB2 acceptable date format. 'CCYY-MM-DD' before using the COBOL field in the query. |
|
Back to top |
|
|
|