View previous topic :: View next topic
|
Author |
Message |
rkprasanth_m
New User
Joined: 22 Jun 2006 Posts: 44
|
|
|
|
can someone tell me how to add business days to a date, like add 1 business day to today. |
|
Back to top |
|
|
emonmisra
New User
Joined: 10 Jul 2006 Posts: 7 Location: Bangalore
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Magna
New User
Joined: 30 Oct 2006 Posts: 24
|
|
|
|
Does your business days include the US holidays or not? |
|
Back to top |
|
|
chinni_reddy
New User
Joined: 26 May 2006 Posts: 2
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi chinni_reddy
Please start new topic. |
|
Back to top |
|
|
vijay_bn79
New User
Joined: 20 Nov 2006 Posts: 48 Location: Hyderabad
|
|
|
|
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 |
|
|
|