+ Reply to Thread
Results 1 to 4 of 4

Thread: Adddur ???

  1. #1
    Guest.Visitor Guest

    Default Adddur ???

    Hi I am trying to get the amount of days from a numeric date in yyyymmdd format.Is possible to do this ex.( adddur fdate:*day fin)? It's telling me that "fin" is not valid for this specific operation. I made fin in my D spec to be a standalone field with a lenght of 3,0. Is this the right way to do this? I have been trying to piece this together using the IBM programmers guide. Any help would be greatly appreciated. thanks Frank

  2. #2
    Guest.Visitor Guest

    Default Adddur ???

    You need to move the numeric date into a date field, then add duration to it and move the result date back into numeric. The ADDDUR opcode will not work with numbers, just dates. ==Scott==

  3. #3
    Guest.Visitor Guest

    Default Adddur ???

    What about the result field? Can it be defined as a numeric field? In my D spec I made a field to be:" Dfdat s 8d" I moved my fdate numeric field like this " *usa move fdate fdat" In the compile I get an error saying fdat is not a numeric field with 0 decimal positions

  4. #4
    Guest.Visitor Guest

    Default Adddur ???

    A quick example of date manipulations:
     * ------------------------------------------------------------------ * * Procedure - EndOfMonth * * Description - Receive a date and return the last day of the month * * Input - InputDate(8,0) in CCYYMMDD format * * Output - Date set to last day of month * * ------------------------------------------------------------------ * p EndOfMonth b Export d EndOfMonth pi d DatFmt(*ISO) d InputDate d Const DatFmt(*ISO) d NextMth s d DatFmt(*ISO) d nDay s 5i 0 d EndDate s d c test(e) InputDate c if %error c return *loval c endif c InputDate adddur 1:*Months NextMth c extrct NextMth:*Days nDay c NextMth subdur nDay:*Days EndDate c return EndDate p EndOfMonth e 

+ Reply to Thread

Similar Threads

  1. Replies: 7
    Last Post: 07-13-2001, 03:58 AM
  2. Problem with the adddur opcode
    By Guest.Visitor in forum Programming
    Replies: 2
    Last Post: 02-03-2001, 10:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts