MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Date formats

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Mon Aug 30, 2004 12:09 pm    Post subject: Date formats Reply with quote

I know TSO REXX has several DATE() functiosn but none of them return the date in the format of yymmdd ( closest I get I get is DATE('E') which returns the date in format yy/mm/dd.

Is there any way to get the format I want ?
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Aug 30, 2004 1:04 pm    Post subject: Reply with quote

Date(S) will give you YYYYMMDD.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 30, 2004 1:07 pm    Post subject: Reply with quote

John Corbin,

Did you try Date(S) ? which returns yyyymmdd format? if you need just 2 digits then you can use substring function to strip the century portion. Check this link.

http://www.mvsforums.com/helpboards/viewtopic.php?t=228

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon Aug 30, 2004 1:08 pm    Post subject: Reply with quote

Also, if ISPF is available in the environment, you could concatenate the three ISPF date variables:

zyear = 04
zmonth = 08
zday = 04
Back to top
View user's profile Send private message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Mon Aug 30, 2004 1:10 pm    Post subject: My attempt Reply with quote

Thanks for the suggestions... here is a partial solution..

/* REXX */
TODAYSDATE=DATE('E')
RYEAR=SUBSTR(TODAYSDATE,1,2)
RMONTH=SUBSTR(TODAYSDATE,4,2)
RDAY=SUBSTR(TODAYSDATE,6,2)
/* REXX */


Now I have to join the 3 small strings into yymmdd....
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 30, 2004 1:34 pm    Post subject: Reply with quote

johncorbin,

You can simply code

Code:

/* REXX */                         
TODAYSDATE=SUBSTR(DATE('S'),3,6)   
SAY TODAYSDATE                     


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Tue Aug 31, 2004 2:17 pm    Post subject: Thanks for all the input Reply with quote

Up and running now... Thanks..

Virtual beer for all
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group