You are a great help. It assumes you're able to figure out what day of the week you're on now. Integer-date represents a number of days after December 31, 1600, in the Gregorian calendar. You should have a data format that is number of days since the first of the year, or number of days since some arbitrary date Jan 1, 1900 and Jan 1, 1600 are popular choices. Still getting the same error.
Global moderator Posts: 3804 Joined: Tue Jan 25, 2011 12:02 am Has thanked: times Been thanked: times See section 6. You just need to implement a 'carry' for months and years in the even you cross a month or year boundary. I say it does not define because 5. It's easy to and it's free. The Supreme Court tried with equal dedication to define 'obscenity. Anuj Dhawan Senior Member Joined: 22 Apr 2006 Location: Mumbai, India Posted: Fri Apr 24, 2009 12:01 pm Post subject: Hi, Check this link on hernikiten New User Joined: 08 Apr 2005 Location: india Posted: Fri Apr 24, 2009 5:54 pm Post subject: Reply to: converting Gregorian date to Integer of date - Err I am conforming to the same data type. Fixed-point data items are undefined.
Check out this code example for how to write your own date handling routine. Functions are handy tools, and are exceedingly easier than the methods we previously used that required copious amounts of code to convert a Gregorian date to a Julian date and vice versa. They may be used in a subset of places that an integer data item may be used i. NicC is right about the Reseved Word unless changed recently. I've been in a few shops and every one of them has had a date function available so I've never had to bother with the details of date manipulation. I am trying to find the number of days difference between two dates.
If the decimal is greater than 5, it will round. The way I understand this is that since we are in 2000, making n 15 would mean the date is in the hundred year range ending in 2015. I suspect you will need to implement something similar. Any invalid dates returns zero for date validation. It explicitly states what a sending field may consist of -- and intrinsic functions do not fall under the sending field definition. That being said, there should be a library of functions available that people have written for these kinds of tasks - surely yours isn't the first application that needed to calculate a date using working days.
It should also be noted that the '85 and 2002 Standards do include definitions of two separate items: - integer literal - integer data item That is because these two items are used separately in the Standard i. Generally you need a lookup table of some sort for this simply because localization determines what these will be; and the actual day of the year varies for several holidays eg. They can be used throughout the Procedure Division. It is for the header of a report and the header writes before the first start date is read. There is a good definition of fixed-point literal, but not fixed-point data item. This converts 20101202 Gregorian date to 0149720 integer format date. Community Help: Cobol Function List - List of all Cobol Intrinsic Functions Cobol has introduced many new intrinsic functions, unless you are running a very old version of cobol you should have these.
Or else has to be defined as numeric. Any optional currency sign specified or any optional commas preceding the decimal point are stripped away, producing a numeric value that can be used in an arithmetic expression. I want to call the subprogram and just return the current date without executing the rest of the program. If week ends are all you need to worry about, then it is not all that difficult to work out what day of the week a given day falls on using. Sorry didn't mention it earlier. Therefore, the distinction needs to be clearer.
The function type is integer. Fixed-point data items are undefined. This was my millennium fix so the system only holds dates since 1900. The function strips away any leading or trailing blanks in the string, producing a numeric value that can be used in an arithmetic expression. Hope this helps, Nina Too Join Tek-Tips ® Today! I searched the 2002 standard without finding a definition.
Cobol Function List - List of all Cobol Intrinsic Functions Cobol Intrinsic Functions. Argument must be alphabetic or alphanumeric, and must be at least one character in length. Post navigation I have 2 sub-routines to handle dates and date validation these are days1900. But it does not define what an integer is, only where integers must be used. Group names are, by definition, alphanumeric. It is easy with these functions. Therefore, the distinction needs to be clearer.
Make sure your data is good. Another day, another thing learned. So really just the 500-format-date needs to be executed along with the current-date function. The function result is a seven-digit integer with a range from 1 to 3,067,671. Fixed-point data items are undefined. Once you have added the days, convert the result to whatever format you need.
. Although easy enough to state, your problem is actually fairly complex to implement. No-one moaning it doesn't work. You should read up on this if you ever use it!!! This only works for the current date though. Functions are elementary data items that will return a numeric whole or decimal or an alphanumeric. I'm going to assume you're not working in a new shop.