|
Sorry... when I said 'easier' I meant for a non-ILE program. Basil Zangare Applications Specialist Nikon Inc 1300 Walt Whitman Road Melville, New York 11747 phone: (631) 547-4389 fax: (631) 547-4026 bzangare@xxxxxxxxx -----Original Message----- From: cobol400-l-bounces@xxxxxxxxxxxx [mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of Zangare Basil Sent: Wednesday, August 16, 2006 9:36 AM To: COBOL Programming on the iSeries/AS400 Subject: Re: [COBOL400-L] Day of the week Wouldn't it be easier to call a CL program and execute the following command: RTVSYSVAL SYSVAL(QDAYOFWEEK) RTNVAR(&DAYOFWEEK) The value retrieved is in the format "*WED" which could be converted to "Wednesday" with either a table search or IF or CASE type statement in the CL or main program. I would prefer to do it all in the CL and return "Wednesday". This way there would be less code to insert if the call is added to other programs. Basil Zangare Applications Specialist Nikon Inc 1300 Walt Whitman Road Melville, New York 11747 phone: (631) 547-4389 fax: (631) 547-4026 bzangare@xxxxxxxxx -----Original Message----- From: cobol400-l-bounces@xxxxxxxxxxxx [mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jim Essinger Sent: Tuesday, August 15, 2006 5:00 PM To: COBOL Programming on the iSeries/AS400 Subject: Re: [COBOL400-L] Day of the week Hello, I have a program that we used here for dates, until we went to the date data types, and ILE. The code for that program can be found at: http://code.midrange.com/index.php?id=df0f108368 You pass the program MM DD and CCYY and get back a Julian type date - useful in subtracting or adding days, and a day of the week. I also have a program that converts that Julian style date back to Gregorian so after you do the math (adding or subtracting days from the Julian date) you can get the MM DD CCYY and day of week back. I can post that if you would like. I would suggest that you start to use ILE and the date data types. much better and easier to deal with, and little or no date limitations. HTH On 8/15/06, Semiha Balkaya(İşbank) <sbalkaya@xxxxxxxxxxxxx> wrote:
Hi there Is there any way to retrieve Day Of Week value in COBOL/400? I don't use ILE COBOL and when I try the statement for ILE COBOL, sure it gives syntax error written in below. How can I get this value in my program? Message . . . . : ANS COBOL reserved word DAY-OF-WEEK will be accepted as a nonreserved word. Cause . . . . . : DAY-OF-WEEK is a reserved word in the 1985 ANSI COBOL standard (revised 1989), but it is not a COBOL/400* reserved word. Recovery . . . : Do not use ANS (American National Standard) COBOL reserved words that are not COBOL/400 reserved words. In ILE Cobol you can: 77 w-giorno pic 9(1) value zero. ACCEPT w-giorno from DAY-OF-WEEK display " today is " w-giorno ".th day of the week". Good luck. Domenico Finucci
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.