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
 
date logic

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sumannaidu

New User


Joined: 21 May 2005
Posts: 13
Location: Bangalore

PostPosted: Wed Dec 12, 2007 3:28 pm    Post subject: date logic
Reply with quote

Hi All,

I got a requirement that it extracts data between two given date.

if the week spans falls in two different months for ex:from 30th of july to 5th of august then we will have two datecard output files RPTHDR1 RPTHDR2 .
RPTHDTR1 will have date from 30th july to 31st july.
and RPTHDR2 will have from 1st aug to 5 aug.

and we will be extracting RPTDHR1 data in one file and and RPTDHR2 data in a different file.

can anyone have similar logic which does the same.. please reply me

.........suman
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Dec 12, 2007 7:08 pm    Post subject:
Reply with quote

Suman,

Step1 : Convert your dates to Julian format.
Step 2: Verify last day of the month (in julian) falls with your date range. If it is, then split the week into 'two' ranges.

Caution: Need to be careful for 'Leap years'.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Wed Dec 12, 2007 7:33 pm    Post subject: Reply to: date logic
Reply with quote

date logic is usually very tricky expecially for business dates..
is not something that can be done by general use tools/utilities even if
they are as smart as dfsort..

it' s usually related to the concept of "work day",
every country has a calendar with country related holidays,
and some companies have their own holidays

so all said , to compute a working day after or before a certain date
is a little bit complicated, involving not only arithmetic, but also tabular searches
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Wed Dec 12, 2007 9:38 pm    Post subject:
Reply with quote

Where would you like to get the date range/ranges, a parm or from the system date? What format is the date stored in the input file? If you get 2 date ranges (the date range for the first file and the date range for the second file) the compares could be done either with julian dates or with dates in CCYYMMDD format. If the time period did not span months you could put something in the second date range that would not extract anything to the second file.
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 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
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm

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