× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



"COBOL400-L" <cobol400-l-bounces@xxxxxxxxxxxx> wrote on 09/07/2016
01:00:02 PM:

----- Message from "Stone, Joel" <Joel.Stone@xxxxxxxxxx> on Wed, 7
Sep 2016 16:14:35 +0000 -----

To:

"'COBOL Programming on the IBM i (AS/400 and iSeries)'" <cobol400-
l@xxxxxxxxxxxx>

Subject:

[COBOL400-L] help! Any idea why this date function will not compile?

Does the add-duration function not work on database fields?

Why is the field: A0704-DTDUE-DT appearing in the memory map as AN
(alpha) when the compiler KNOWS that it is a date data type? How
can I get the compiler to recognize that the field is a date?

V7r1


Thanks!


Database field:

65 +000022 06 A0704-DTDUE-DT PIC X(8).
+000023* DUE DT
+000024* (Date field)



662 044400 move function ADD-DURATION
044500 (A0704-DTdue-dt of CSCDATEr days 5)
044600 to A0704-DTdue-dt of CSCDATEr


* 662 MSGID: LNC2767 SEVERITY: 30 SEQNBR: 044500
Message . . . . : Function argument 'A0704-DTDUE-DT OF
CSCDATER' did
not have the correct type for function 'FUNCTION
ADD-DURATION'.



On your CRTBNDCBL or CRTCBLMOD command, you have to specify
CVTOPT(*DATETIME) to get the compiler to generate named fields. It appears
you've done that. However, you also have to specify *DATE for it to
generate date fields--e.g., CVTOPT(*DATETIME *DATE).

Here's the help text from the compile command:
*NODATE
DDS date data types are declared as category alphanumeric COBOL date
items, for example:

06 FILLER PIC X(10).

The COBOL data item name is determined by the *NODATETIME/*DATETIME
CVTOPT parameter.

*DATE
DDS date data types are declared as category date COBOL data items,
for example:

06 FILLER FORMAT DATE '@Y-%m-%d'.

Note that *NODATE is the default just as *NODATETIME is the default.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.