× 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.



Because date support was added to the compiler after the advent of dates in the database the compiler by default brings in all dates as a character string.

If you want them usable directly as dates then you need to specify the CVTOPT *DATE etc.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Sep 7, 2016, at 12:14 PM, Stone, Joel <Joel.Stone@xxxxxxxxxx> wrote:

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'.


*map on compile:

65 06 A0704-DTDUE-DT FS 00000019 8 AN





Here is a map of a date data type in WS:

499 05 WS-DATE WS 00000065 8 DT






Create Bound COBOL Program (CRTBNDCBL)

Type choices, press Enter.

Program . . . . . . . . . . . . > CMP704I Name, *PGMI
Library . . . . . . . . . . . > JSTONE Name, *CURL
Source file . . . . . . . . . . > S Name
Library . . . . . . . . . . . *LIBL Name, *LIBL
Source member . . . . . . . . . *PGM Name, *PGM
Source stream file . . . . . . .

Generation severity level . . . 30 0-30
Text 'description' . . . . . . . *SRCMBRTXT


Additional Parameters

Conversion options . . . . . . . > *DATETIME
+ for more values
--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.