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

date logic


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Wed Dec 12, 2007 7:08 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 12, 2007 7:33 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
Search our Forums:

Back to Top