Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us