|
How many digits does the date function return? Which Cobol are you using (OPM or ILE)? Cheers, JP "Eric Tubbs" <eatubbs@email.com> To: cobol400-l@midrange.com Sent by: cc: cobol400-l-admin@mi Subject: Date Handling Problem drange.com 14/08/2002 16:34 Please respond to cobol400-l [ 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. -- _______________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com[1] ===References:=== 1. http://www.mail.com/?sr=signup _______________________________________________ This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list To post a message email: COBOL400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/cobol400-l or email: COBOL400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/cobol400-l. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. postmaster@bif.ie **********************************************************************
As an Amazon Associate we earn from qualifying purchases.
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.