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



Eric,

Check your ACCEPT statement.  I think you'll find that
the default date returned is different from you
working-storage layout :)

Just a hint...

Terry

> -----Original Message-----
> From: Eric Tubbs [mailto:eatubbs@email.com]
> Sent: Wednesday, August 14, 2002 11:34 AM
> To: cobol400-l@midrange.com
> Subject: Date Handling Problem
>
>
> [ Converted text/html to text/plain ]
>
> Greetings all again,
>
> I have come across a predictament that I havent been able to
> fully solve. My
> efforts have landed me pretty darn close, but I cannot seem
> to figure the rest
> out. Figuring out how to get the date working correctly has
> been a challenge
> for me (a student). As you can see from the the Printer
> Spacing Chart below,
> it shows today's date, but the year is being displayed wrong.
>
> Would somebody please like to point me in the right direction
> (and not just
> giving me the answer and sending me along my way please,
> because I still want
> to learn) of where I am messing up? The only item that doesnt
> work in my
> program is this. I have included the following sections of
> code that I felt
> were revelant to this question without having to put my who
> program in this
> posting.
>
> Many thanks to all,
>
> Eric
>
> *...+....1....+....2....+....3....+....4....+....5....+....6..
> ..+....7....+...
> 08/14/0002    CUSTOMER ELECTRICITY AND GAS USAGE REPORT
>   PAGE  1
>      ACCOUNT                              ELECT     ELECT
>   GAS      GAS
>      NUMBER   CUSTOMER NAME                USED      BILL
>   USED     BILL
>      12345    Yanni      Lostly            1,204    $456.00      984
> $654.00
>      54687    Paul       Winters           9,874     $15.04      845
> $2.47
>       8745    Samuel     Taylor           78,954    $235.85   56,412
> $587.47
>
>
>
> 0057.00        WORKING-STORAGE SECTION.
> 0058.00
> 0059.00        01  WS-CONTROL-FIELDS.
> 0060.00            05  ARE-THERE-MORE-RECORDS      PIC X(03)
> VALUE 'YES'.
> 0061.00            05  WS-LINE-COUNTER             PIC 9(03)
> PACKED-DECIMAL
> 0062.00
> VALUE 60.
> 0063.00            05  WS-LINE-LIMIT               PIC 9(03)
> PACKED-DECIMAL
> 0064.00
> VALUE 60.
> 0065.00            05  WS-PAGE-COUNTER             PIC 9(03)
> PACKED-DECIMAL
> 0066.00
> VALUE ZERO.
> 0067.00        01  TODAYS-DATE                     PIC 9(8).
> 0068.00
> 0069.00        01  TODAYS-DATE-R REDEFINES TODAYS-DATE.
> 0070.00            05  TD-YEAR                     PIC 9(4).
> 0071.00            05  TD-MONTH                    PIC 9(2).
> 0072.00            05  TD-DAY                      PIC 9(2).
> 0073.00
> 0074.00        01  HEADING-1.
> 0075.00            05  HL-MONTH                    PIC 9(02).
> 0076.00            05                              PIC X
> VALUE '/'.
> 0077.00            05  HL-DAY                      PIC 9(02).
> 0078.00            05                              PIC X
> VALUE '/'.
> 0079.00            05  HL-YEAR                     PIC 9(04).
> 0080.00            05                              PIC X(04).
>
> 0133.00        PROCEDURE DIVISION.
> 0134.00
> 0135.00        000-MAIN-MODULE.
> 0136.00
> 0137.00            OPEN INPUT  CUSTOMER-USAGE-FILE
> 0138.00                 OUTPUT CUSTOMER-USAGE-REPORT.
> 0139.00
> 0140.00            ACCEPT TODAYS-DATE FROM DATE.
> 0141.00            MOVE TD-MONTH TO HL-MONTH.
> 0142.00            MOVE TD-DAY TO HL-DAY.
> 0143.00            MOVE TD-YEAR TO HL-YEAR.
> --


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.