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

How to add buseness days to a date


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

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Thu Nov 09, 2006 6:20 pm
Reply with quote

can someone tell me how to add business days to a date, like add 1 business day to today.
Back to top
View user's profile Send private message
emonmisra

New User


Joined: 10 Jul 2006
Posts: 7
Location: Bangalore

PostPosted: Thu Nov 09, 2006 6:52 pm
Reply with quote

Hi,

You have to write the logic with(if and evalute keywords) to add 1 to the Business day means today's date.

If it is CObol program you can write in the Procedure division

ACCEPT CurrentDate FROM DATE

DATE is system variable (check the format) . It is 6 digit date .
then separate the month,day, yr moving this to the group variable.

apply your program logic .
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Nov 10, 2006 4:31 am
Reply with quote

Well, let?s look at this.

If today is Nov 7, 2006 and you add one business day you will want Nov 8, 2006. But if today is Nov 10, 2006 (Friday) you want Nov 13, 2006 (Monday), assuming Saturday and Sunday are not business days. And if Nov 13, 2006 is a holiday you will want Nov 14, 2006.

Since there is no set business, or non-business days, the only way to do this is to have a short file with the exceptions to the ?normal? mon-fri business days. When you add or subtract business days, you must interrogate the file for non-business day exceptions. It?s not a pretty process.

Dave
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Nov 10, 2006 5:59 am
Reply with quote

a couple of comments.

The Language Environment extentions provide a lot of intrinsic functions that can be CALLed by cobol. any documents with CEE prefix is LE. But some shops don't have LE.

Most businesses have some kind of system calendar, which would include declarations for such things as holidays, work-week number, work-day number, business days, etc... If nothing else, payroll has one. Any business that performs billing will have such a calendar; and routines to access.

Something that is important as Business day or holiday calculations must be a centralized BUSINESS CONCEPT. If you shop does not have one, it should. I would ask around and find the one that has been accepted by the auditors.

Saturday is day 1 in Kuwait (most of the middle east).
Back to top
View user's profile Send private message
Magna

New User


Joined: 30 Oct 2006
Posts: 24

PostPosted: Fri Nov 10, 2006 6:27 am
Reply with quote

Does your business days include the US holidays or not?
Back to top
View user's profile Send private message
chinni_reddy

New User


Joined: 26 May 2006
Posts: 2

PostPosted: Wed Nov 15, 2006 1:15 pm
Reply with quote

Hi,

How to check for low values in cobol,
I want to dispaly particular field if it has low values / high values, so for this I want to write a cobol program. Pls help me
IF FIELD-NAME = LOWVALUES

THEN DISPALY FIELD-NAME.

Will the above codition works,

Thanks,
Sunitha
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Nov 15, 2006 2:18 pm
Reply with quote

Hi chinni_reddy


Please start new topic.
Back to top
View user's profile Send private message
vijay_bn79

New User


Joined: 20 Nov 2006
Posts: 48
Location: Hyderabad

PostPosted: Mon Nov 20, 2006 3:27 pm
Reply with quote

chinni_reddy wrote:
Hi,

How to check for low values in cobol,
I want to dispaly particular field if it has low values / high values, so for this I want to write a cobol program. Pls help me
IF FIELD-NAME = LOWVALUES

THEN DISPALY FIELD-NAME.

Will the above codition works,

Thanks,
Sunitha



Hi...


i am giving you some examples
these may helps you to understand

Example for HIGH-VALUES

IF TRAILER-KEY2 = HIGH-VALUES
MOVE TRAIL-INPUT2 TO TRAIL-INPUT3
WRITE TRAIL-INPUT3
ADD 1 TO WS-OUT-RET
ADD 1 TO WS-TRAI-RET
ADD 1 TO WS-TRAI-RED
DISPLAY 'THE FILE NAME IS FILE-INPUT'
END-IF

Example for LOW-VALUES

IF HEADER-KEY2 OF HEAD-INPUT2 = LOW-VALUES
MOVE 1 TO WS-CHECK
ADD 1 TO WS-TOTAL-TRANS
ADD 1 TO WS-HEAD-RED
DISPLAY 'THE FILE NAME IS FILE-INPUT1'
ELSE
CONTINUE
END-IF


Thanks
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 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
Search our Forums:

Back to Top