How can I get the day of the week using CL ? Silvio Santos silvio.santos@biw-ag.de
How can I get the day of the week using CL ? Silvio Santos silvio.santos@biw-ag.de
On Wednesday, August 19, 1998, 03:48 AM, Sílvio Santos wrote: How can I get the day of the week using CL ? System value QDAYOFWEEK (use RTVSYSVAL command) will give you the day of week for the current system date. Best regards, Carsten Flensburg
On Wednesday, August 19, 1998, 03:48 AM, Sílvio Santos wrote: How can I get the day of the week using CL ? Silvio Santos silvio.santos@biw-ag.de Like this:PGM DCL VAR(&InDate) TYPE(*CHAR) LEN(32) + VALUE('08/19/1998 ') DCL VAR(&InPict) TYPE(*CHAR) LEN(32) + VALUE('MM/DD/YYYY ') DCL VAR(&OUTPICT) TYPE(*CHAR) LEN(32) + VALUE('Wwwwwwwwww ') DCL VAR(&OutDate) TYPE(*CHAR) LEN(32) DCL VAR(&LilDate) TYPE(*CHAR) LEN(4) DCL VAR(&FC) TYPE(*CHAR) LEN(12) CALLPRC PRC(CEEDAYS) PARM(&INDATE &INPICT &LILDATE &FC) CALLPRC PRC(CEEDATE) PARM(&LILDATE &OUTPICT &OUTDATE)/* Value of &OUTDATE is 'Wednesday ' */ ENDPGM One day, we'll all be heroes.
If what you want is the day of the week for TODAY (wednesday) just do RTVSYSVAL , hit CMD4 and pick out the variable you want... You don't need a bunch of CODE .
......Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080
On Wednesday, August 19, 1998, 04:50 PM, Bob Hamilton wrote: If what you want is the day of the week for TODAY (wednesday) just do RTVSYSVAL , hit CMD4 and pick out the variable you want... You don't need a bunch of CODE . ...... Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080
Thanks I was about to type the same response...........sometimes letting the air out of the tires to free the truck from the bridge is just too simple. Just trying to keep up....
On Wednesday, August 19, 1998, 03:48 AM, Sílvio Santos wrote: How can I get the day of the week using CL ? Silvio Santos silvio.santos@biw-ag.de I see nothing in Silvio's original post that indicates he only wants the day of the week for today. In my experience, the date a program is manipulating is almost never today. It's order date, or hire date, or month-end date, etc. I merely gave him a solution that works for ALL dates. Was I wrong? One day, we'll all be heroes.
On Thursday, August 20, 1998, 06:58 AM, Michael Daly wrote: I see nothing in Silvio's original post that indicates he only wants the day of the week for today. In my experience, the date a program is manipulating is almost never today. It's order date, or hire date, or month-end date, etc. I merely gave him a solution that works for ALL dates. Was I wrong? Michael, FWIW: Your answer was excellent. It covered all dates. I nominate it for Tech Talk. Chris
On Thursday, August 20, 1998, 07:37 AM, Chris Ringer wrote: Michael, FWIW: Your answer was excellent. It covered all dates. I nominate it for Tech Talk. Chris Thanks, Chris, for the vote of confidence. TechTalk? Maybe. Perhaps I should add some error checking and pass the parms in? Maybe something like this: /************************************************** ****//* *//* PROGRAM : DayOfWeek *//* CREATED BY: Michael Daly *//* CREATED DT: 08/20/1998 *//* PURPOSE: To return the day of the week provided *//* a given date. *//************************************************** ****/ PGM PARM(&INDATE &INPICT &OUTDATE &ERRCODE) DCL VAR(&InDate) TYPE(*CHAR) LEN(32) DCL VAR(&InPict) TYPE(*CHAR) LEN(32) DCL VAR(&OutDate) TYPE(*CHAR) LEN(32) DCL VAR(&ERRCODE) TYPE(*CHAR) LEN(1) DCL VAR(&OUTPICT) TYPE(*CHAR) LEN(32) + VALUE('Wwwwwwwwww') DCL VAR(&LilDate) TYPE(*CHAR) LEN(4) DCL VAR(&FC) TYPE(*CHAR) LEN(12) DCL VAR(&ISI) TYPE(*CHAR) LEN(4) DCL VAR(&ISIDEC) TYPE(*DEC) LEN(9 0) CALLPRC PRC(CEEDAYS) PARM(&INDATE &INPICT &LILDATE &FC) CHGVAR VAR(&ISI) VALUE(%SST(&FC 9 4)) CHGVAR VAR(&ISIDEC) VALUE(%bin(&ISI)) IF COND(&ISIDEC *EQ 0) THEN(DO) CALLPRC PRC(CEEDATE) PARM(&LILDATE &OUTPICT &OUTDATE) CHGVAR VAR(&ERRCODE) VALUE('N') ENDDO ELSE CMD(DO) CHGVAR VAR(&ERRCODE) VALUE('Y') ENDDO ENDPGM One day, we'll all be heroes.
I have submitted it to the proper person.
On Thursday, August 20, 1998, 09:05 AM, Michael Daly wrote: Thanks, Chris, for the vote of confidence. TechTalk? Maybe. Perhaps I should add some error checking and pass the parms in? Maybe something like this: /************************************************** ****/ /* */ /* PROGRAM : DayOfWeek */ /* CREATED BY: Michael Daly */ /* CREATED DT: 08/20/1998 */ /* PURPOSE: To return the day of the week provided */ /* a given date. */ /************************************************** ****/ snip
On Thursday, August 20, 1998, 02:01 PM, Ted Holt wrote: I have submitted it to the proper person. On Thursday, August 20, 1998, 09:05 AM, Michael Daly wrote: Thanks, Chris, for the vote of confidence. TechTalk? Maybe. Perhaps I should add some error checking and pass the parms in? Maybe something like this: /************************************************** ****/ /* */ /* PROGRAM : DayOfWeek */ /* CREATED BY: Michael Daly */ /* CREATED DT: 08/20/1998 */ /* PURPOSE: To return the day of the week provided */ /* a given date. */ /************************************************** ****/ snip It's already in my folder to share with the team, Thanks!! There's never time to do it right, but.....there's always time to do it over.