Hi all,
I want to write a PL/I program on how to find the "day of the date".
I know how to fetch the date from the system date.
But I want to know is there any function to convert the date's day(number) into day of the week.
Please guide me on building the logic.
Any help would be appreciated.
Thank you,
Siddu
How to find the day of the Date ?
-
- Posts: 3
- Joined: Mon Jul 08, 2013 11:45 am
- Skillset: Cobol, Pli, JCL, CICS, VSAM, DB2
- Referer: Google
- Stefan
- Posts: 27
- Joined: Tue Aug 21, 2012 3:02 pm
- Skillset: Application development, configuration management, maintaining test environments
- Referer: world wide web
Re: How to find the day of the Date ?
Code: Select all
SELECT
CASE
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 1 THEN 'SUNDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 2 THEN 'MONDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 3 THEN 'TUESDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 4 THEN 'WEDNESDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 5 THEN 'THURSDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 6 THEN 'FRIDAY'
ELSE 'SATURDAY'
END
FROM SYSIBM.SYSDUMMY1;
There are 10 types of people in the world: Those who understand binary, and those who don't.
-
- Posts: 3
- Joined: Mon Jul 08, 2013 11:45 am
- Skillset: Cobol, Pli, JCL, CICS, VSAM, DB2
- Referer: Google
Re: How to find the day of the Date ?
Thank you Stefan... 

- Akatsukami
- Global moderator
- Posts: 1058
- Joined: Sat Oct 16, 2010 2:31 am
- Skillset: Rexx, JCL, DB2/SQL, TSO/ISPF, PL/I
- Referer: ibmmainframes
- Location: Bloomington, IL
- Contact:
Re: How to find the day of the Date ?
Stefan wrote:Code: Select all
SELECT
CASE
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 1 THEN 'SUNDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 2 THEN 'MONDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 3 THEN 'TUESDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 4 THEN 'WEDNESDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 5 THEN 'THURSDAY'
WHEN DAYOFWEEK(CURRENT TIMESTAMP) = 6 THEN 'FRIDAY'
ELSE 'SATURDAY'
END
FROM SYSIBM.SYSDUMMY1;
Is that not rather a SQL solution than a PL/I one?
Code: Select all
dcl dayofweek char (90;
select (weekday());
when (1) dayofweek = 'Sunday';
when (2) dayofweek = 'Monday';
when (3) dayofweek = 'Tuesday';
when (4) dayofweek = 'Wednesday';
when (5) dayofweek = 'Thursday';
when (6) dayofweek = 'Friday';
when (7) dayofweek = 'Saturday';
end
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
-
- Posts: 3
- Joined: Mon Jul 08, 2013 11:45 am
- Skillset: Cobol, Pli, JCL, CICS, VSAM, DB2
- Referer: Google
Re: How to find the day of the Date ?
Yes.
I executed the code..
It does look like a SQL code.
Will try with other logic(mentioned by Akatsukami) and reply..
Thank you.
I executed the code..
It does look like a SQL code.
Will try with other logic(mentioned by Akatsukami) and reply..
Thank you.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
REXX Code to find if PDS JCL member has how many DD
by abhilashanaik » Tue Sep 14, 2021 11:17 am » in CLIST & REXX - 5
- 2301
-
by sergeyken
View the latest post
Wed Sep 15, 2021 6:02 am
-
-
- 3
- 1211
-
by sergeyken
View the latest post
Wed May 18, 2022 4:40 pm
-
-
Find the version of a cobol program through its load module
by vinigim » Fri Oct 30, 2020 3:16 am » in IBM Cobol - 5
- 5156
-
by chaat
View the latest post
Sat Nov 07, 2020 8:40 am
-
-
- 3
- 1518
-
by sergeyken
View the latest post
Sun Nov 29, 2020 6:47 am
-
- 1
- 5699
-
by enrico-sorichetti
View the latest post
Fri Dec 10, 2021 5:23 pm