IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Simulate the start and end date check above using Cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Tue Jul 24, 2007 11:46 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jul 24, 2007 1:14 pm
Reply with quote

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
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Tue Jul 24, 2007 2:11 pm
Reply with quote

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
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Jul 24, 2007 6:39 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top