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
 

 

How to add buseness days to a date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to add buseness days to a date
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    Post subject:
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    Post subject: Re: How to add buseness days to a date
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    Post subject: Re: How to add buseness days to a date
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    Post subject: Re: How to add business days to a date
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    Post subject: Low values check in COBOL
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: 1187
Location: Bangalore,India

PostPosted: Wed Nov 15, 2006 2:18 pm    Post subject:
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    Post subject: Re: Low values check in COBOL
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    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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


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