IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To find the month of a date


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arasi

New User


Joined: 15 Jul 2009
Posts: 6
Location: India

PostPosted: Wed Jul 15, 2009 11:14 am
Reply with quote

Hi all,
Is there any way to find the month of any date.
The Date('Month') gives only the month of current date.
I would like to get the month of any date (eg: 06/15/2009) in the MON format (JUN).

Thanks in advance!
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Jul 15, 2009 11:37 am
Reply with quote

Arasi,

Hi and Welcome to the forums

Quote:
I would like to get the month of any date (eg: 06/15/2009) in the MON format (JUN).


I don't think if there is any in-built function for what you had asked for.

You can PARSE the month , check the value and then display the corresponding MONTH. All you have to do is 12 checks (IF ELSE).
Back to top
View user's profile Send private message
Arasi

New User


Joined: 15 Jul 2009
Posts: 6
Location: India

PostPosted: Wed Jul 15, 2009 11:41 am
Reply with quote

Thank you Aaru. So I will go for select statement.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jul 15, 2009 12:04 pm
Reply with quote

REread the rexx manual about the DATE function

manuals link at the top of the page
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Jul 15, 2009 12:32 pm
Reply with quote

Enrico,

I think, DATE fucntion can only be used for retrieving the system date.

Correct me if I am wrong.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jul 15, 2009 12:52 pm
Reply with quote

Quote:
Correct me if I am wrong.

Naah... correcting is not enough, gimme some time to think and I' ll post the proper punishment icon_biggrin.gif

Rexx DATE is pretty smart, the syntax is
result = DATE(output_date_format[,input_date[,input_date_format]])
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Jul 15, 2009 3:24 pm
Reply with quote

Enrico,

Quote:
Naah... correcting is not enough, gimme some time to think and I' ll post the proper punishment


Hmm.. I deserve it icon_sad.gif

Thanks a lot for the information.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top