Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Manipulating dates and times

To invoke a date or time callable service, use a CALL statement with the correct parameters for that service. You define the data items for the CALL statement in the DATA DIVISION with the data definitions required by that service.

77  argument          pic  s9(9)  comp.
01  format.
    05 format-length  pic  s9(4)  comp.
    05 format-string  pic  x(80).
77  result            pic  x(80).
77  feedback-code     pic  x(12)  display.
. . .
    CALL “CEEDATE” using argument, format, result, feedback-code.

In the example above, the callable service CEEDATE converts a number that represents a Lilian date in the data item argument to a date in character format, which is written to the data item result. The picture string contained in the data item format controls the format of the conversion. Information about the success or failure of the call is returned in the data item feedback-code.

In the CALL statements that you use to invoke the date and time callable services, you must use a literal for the program-name rather than an identifier.

A program calls the date and time callable services by using the standard system linkage convention. Therefore, either compile the program using the CALLINT(SYSTEM) compiler option (the default) or use the >>CALLINTERFACE SYSTEM compiler-directing statement.

Example: manipulating dates

related concepts
Appendix E. Date and time callable services

related tasks
Getting feedback from date and time callable services
Handling conditions from date and time callable services

related references
Feedback token
Picture character terms and strings
CALLINT
Compiler-directing statements
CALL statement (COBOL for Windows Language Reference)


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)