|
I'm not sure how that would be easier. The program is written, all you have to do is compile it and call it. With a CL or this COBOL program you have to test the result passed back and test. Also the day of the week was not specified (but I can see it as being implied) as today. If you want to find the day of the week for 60 days from today, or 12 days ago, can you do that in the CL program easily? Calling a CL program might be a better solution, as it might not be date restricted like the one I posted, but you can't do date calcs with it. It would be a better solution to use ILE and all the date type functionality that comes with it, but that was not the requirement. This also keeps the solution all COBOL. Thanks! On 8/16/06, Zangare Basil <bzangare@xxxxxxxxx> wrote:
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 > -- Jim Essinger Senior Programmer/Analyst UnLtd/SLFI/IMA PO Box 730 Fruitland, ID 83619 208-452-4058 x133 -- This is the COBOL Programming on the iSeries/AS400 (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. -- This is the COBOL Programming on the iSeries/AS400 (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. -- This is the COBOL Programming on the iSeries/AS400 (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 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.