Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Simulate the start and end date check above using Cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Simulate the start and end date check above using Cobol
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: 3158
Location: Tucson AZ

PostPosted: Tue Jul 24, 2007 1:14 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us