Discussion:
Help with Date Conversions
(too old to reply)
Lizette Koehler
2016-01-05 00:16:10 UTC
Permalink
Raw Message
the REXX manuals are somewhat light on how to convert the dates using DATE function.

I have a date of 2016001 and I want to display it as Jan 1, 2016 or 2016 Jan 01

Tell me this is easy with the DATE('N','2016001','s')

Or do I need to translate the 2016001 to 20160101 first?

I also have a date of 2016.001 - same question.

Lastly, is there any doc someone wrote on how to use the DATE function in REXX better? I seem to be doing a lot of trial with many errors.

:(

Thanks

Lizette

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
John McKown
2016-01-05 01:00:16 UTC
Permalink
Raw Message
Post by Lizette Koehler
the REXX manuals are somewhat light on how to convert the dates using DATE function.
I have a date of 2016001 and I want to display it as Jan 1, 2016 or 2016 Jan 01
Tell me this is easy with the DATE('N','2016001','s')
​I don't think so. The only format option that I see which accepts a
"julian" date​ is "J", and it only accepts a 2 digit year and so is not
"general". What I do is something like:

YYYY=LEFT(INPUT_DATE,4)
DDD = RIGHT(INPUT_DATE,3)
/* CONVERT STANDARD FORMAT DATE TO BASE FOR JAN 1 OF YEAR, THEN ADD
DAY-IN-YEAR MINUS 1 */
BASEDATE=DATE('B',YYYY||"0101",'S')+DDD-1
/* CONVERT BASE FORMAT TO DAY MON YEAR FORMAT */
OUTPUT=DATE('N',BASEDATE,'B')

Run it all together to be even more incomprehensible

OUTPUT=DATE('N',(DATE('B',LEFT(INPUT_DATE),4)||"0101",'S')+RIGHT(INPUT_DATE,3)-1),'B')
Post by Lizette Koehler
Or do I need to translate the 2016001 to 20160101 first?
​This is what DATE('B',YYYY||"0101",'S')+DDD-1 does​
Post by Lizette Koehler
I also have a date of 2016.001 - same question.
​Same answer as above because with 2016.001 YYYY=2016 and DDD=001 just as
above. The period is basically not involved.​
Post by Lizette Koehler
Lastly, is there any doc someone wrote on how to use the DATE function in
REXX better? I seem to be doing a lot of trial with many errors.
​Not that I know of. I'm just used to doing weird things in many different
languages.​ You _don't_ want to look at my PERL or APL!
Post by Lizette Koehler
:(
Thanks
Lizette
--
Computer Science is the only discipline in which we view adding a new wing
to a building as being maintenance -- Jim Horning

Schrodinger's backup: The condition of any backup is unknown until a
restore is attempted.

Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be.

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Zelden, Mark
2016-01-05 14:11:35 UTC
Permalink
Raw Message
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of John McKown
Sent: Monday, January 04, 2016 7:00 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions
Post by Lizette Koehler
the REXX manuals are somewhat light on how to convert the dates using DATE function.
I have a date of 2016001 and I want to display it as Jan 1, 2016 or 2016 Jan 01
Tell me this is easy with the DATE('N','2016001','s')
​I don't think so. The only format option that I see which accepts a "julian" date​ is "J", and it only accepts a 2 digit year and so is not "general". What I do is something like:

YYYY=LEFT(INPUT_DATE,4)
DDD = RIGHT(INPUT_DATE,3)
/* CONVERT STANDARD FORMAT DATE TO BASE FOR JAN 1 OF YEAR, THEN ADD DAY-IN-YEAR MINUS 1 */
BASEDATE=DATE('B',YYYY||"0101",'S')+DDD-1
/* CONVERT BASE FORMAT TO DAY MON YEAR FORMAT */
OUTPUT=DATE('N',BASEDATE,'B')

Run it all together to be even more incomprehensible

OUTPUT=DATE('N',(DATE('B',LEFT(INPUT_DATE),4)||"0101",'S')+RIGHT(INPUT_DATE,3)-1),'B')
Post by Lizette Koehler
Or do I need to translate the 2016001 to 20160101 first?
​This is what DATE('B',YYYY||"0101",'S')+DDD-1 does​
Post by Lizette Koehler
I also have a date of 2016.001 - same question.
​Same answer as above because with 2016.001 YYYY=2016 and DDD=001 just as above. The period is basically not involved.​
Post by Lizette Koehler
Lastly, is there any doc someone wrote on how to use the DATE function
in REXX better? I seem to be doing a lot of trial with many errors.
​Not that I know of. I'm just used to doing weird things in many different languages.​ You _don't_ want to look at my PERL or APL!
Post by Lizette Koehler
:(
Thanks
Lizette
Prior to OS/390 2.4, the TSO/E REXX DATE function didn't even do conversions. I wrote RDATE for that
reason and still use it often. You may find it helpful. It's embedded in some of my public execs like
IPLINFO, but it's also on my web site and CBT file 434 as a stand alone exec.

Cheers,

Mark
--

Mark's MVS Utilities: http://www.mzelden.com/mvsutil.html

CSC - This is a PRIVATE message - If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind the Company to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
Robert Zenuk
2016-01-05 14:28:19 UTC
Permalink
Raw Message
Here is some sample date conversion stuff. Someone posted most of this several years ago (sorry, don't remember who). I have added a few small things of my own as examples over the years. Maybe something in here will help with the general question of date conversions. No Roman Numerals though... <grin>

say 'date() --------->' date();
say "date('N',date('J'),'J') -->" date('N',date('J'),'J');
odate = '20150101'
say "date('N',"odate",'S') -->" date('N',odate,'S');
odate = '15001'
say "date('N',"odate",'J') -->" date('N',odate,'J');
say "date('U',date('J'),'J') -->" date('U',date('J'),'J');
say "date('S',date('J'),'J') -->" date('S',date('J'),'J'),
translate('1234/56/78',date('S',date('J'),'J'),'12345678');
say "date('S',date('J'),'J') -->" date('S',date('J'),'J'),
translate('1234-56-78',date('S',date('J'),'J'),'12345678');
say "date('U',date('S'),'S') -->" date('U',date('S'),'S');
say 'date('J') --------->' date('J') translate('12.345',date(j),'12345')
say 'date('C') --------->' date('C');
say 'date('N') --------->' date('N');
MyDate=date('N')
parse upper var MyDate MyDate
say 'UPPER date("N") --->' MyDate
say 'date('W') --------->' date('W');
say 'date('S') --------->' date('S');
today=date('C')
say 'Today is ...............' date('S',today,'C') date('W',today,'C')
say 'Tomorrow is ............' date('S',today+1,'C'),
date('W',today+1,'C')
say 'Yesterday was ..........' date('S',today-1,'C'),
date('W',today-1,'C')
bdate = '19600705'
say 'My birthday.............' bdate date('W',bdate,'S')
say 'Today + 100 days....'date('S',(date('B',date('J'),'J')+100),'B')
say 'Today + 20 days....'date('N',(date('B',date('J'),'J')+20),'B')
say 'Today - 100 days....'date('S',(date('B',date('J'),'J')-100),'B')
say 'Today - 20 days....'date('N',(date('B',date('J'),'J')-20),'B')
say translate('1234-56-78',date(s),'12345678') /* add separators */
say translate('12345678',date(s),'56781234') /* standard to US */
say translate('12-34-5678',date(s),'56781234') /* w/ separators */
say translate('12345678',date(s),'56783412') /* standard to EU */
say translate('12-34-5678',date(s),'56783412') /* w/ separators */
say (date('B')-date('B','00001','J')) 'days since' date('N','00001','J')
say (date('B')-date('B','05035','J')) 'days since' date('N','05035','J')
say 'First day of current month: ' ,
translate('a2345601',date(s),'a23456') /* 1st day of month */
say 'Last day of previous month: ' ,
date(s,date(b,translate('a2345601',date(s),'a23456'),s)-1,b)
say 'DB2 Timestamp format: ', /* DB2 Timestamp */
translate('1234-56-78',date(s),'12345678')||"-"||,
Translate('ab.cd.ef.ghijkl',Time('L'),'ab:cd:ef.ghijkl')
say date('S') time()
sampdate = '2011/04/22'
say sampdate
say space(translate(sampdate,'','/'),0)
say translate(12345678,space(translate(sampdate,'','/'),0),12345678)
say translate('S',space(translate(sampdate,'','/'),0),'N')
say translate('N',space(translate(sampdate,'','/'),0),'S')

Hope this helps,

Rob


-----Original Message-----
From: Zelden, Mark <***@CSC.COM>
To: TSO-REXX <TSO-***@VM.MARIST.EDU>
Sent: Tue, Jan 5, 2016 7:11 am
Subject: Re: Help with Date Conversions


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of John McKown
Sent: Monday, January 04, 2016 7:00 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions
Post by Lizette Koehler
the REXX manuals are somewhat light on how to convert the dates using DATE function.
I have a date of 2016001 and I want to display it as Jan 1, 2016 or 2016
Jan 01
Tell me this is easy with the DATE('N','2016001','s')
​I don't think so. The only format option that I see which accepts a "julian" date​ is "J", and it only accepts a 2 digit year and so is not "general". What I do is something like:

YYYY=LEFT(INPUT_DATE,4)
DDD = RIGHT(INPUT_DATE,3)
/* CONVERT STANDARD FORMAT DATE TO BASE FOR JAN 1 OF YEAR, THEN ADD DAY-IN-YEAR MINUS 1 */
BASEDATE=DATE('B',YYYY||"0101",'S')+DDD-1
/* CONVERT BASE FORMAT TO DAY MON YEAR FORMAT */
OUTPUT=DATE('N',BASEDATE,'B')

Run it all together to be even more incomprehensible

OUTPUT=DATE('N',(DATE('B',LEFT(INPUT_DATE),4)||"0101",'S')+RIGHT(INPUT_DATE,3)-1),'B')
Post by Lizette Koehler
Or do I need to translate the 2016001 to 20160101 first?
​This is what DATE('B',YYYY||"0101",'S')+DDD-1 does​
Post by Lizette Koehler
I also have a date of 2016.001 - same question.
​Same answer as above because with 2016.001 YYYY=2016 and DDD=001 just as above. The period is basically not involved.​
Post by Lizette Koehler
Lastly, is there any doc someone wrote on how to use the DATE function
in REXX better? I seem to be doing a lot of trial with many errors.
​Not that I know of. I'm just used to doing weird things in many different languages.​ You _don't_ want to look at my PERL or APL!
Post by Lizette Koehler
:(
Thanks
Lizette
Prior to OS/390 2.4, the TSO/E REXX DATE function didn't even do conversions. I wrote RDATE for that
reason and still use it often. You may find it helpful. It's embedded in some of my public execs like
IPLINFO, but it's also on my web site and CBT file 434 as a stand alone exec.

Cheers,

Mark
--

Mark's MVS Utilities: http://www.mzelden.com/mvsutil.html

CSC - This is a PRIVATE message - If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind the Company to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Sevetson, Phil
2016-01-05 14:50:12 UTC
Permalink
Raw Message
Rob,
By the time the list manager got through with it, some of your code was concatenated and some was repaginated so that some lines went beyond 72 characters, and some SAY verbs were on the same line as others, without intervening semicolons. I'm going to try to reformat and see if I can get the list manager to honor CRLF/Newline/Whatever. If this fails, I'll put a text file up on Dropbox for a few days and post the link here.

First cut: here's the reformatted text, which was cut-and-pasted (with trailing blanks removed) from an Attachmate 3270 emulator session. It looks good in my sending window -- we'll see what it looks like after list manager software.

/* REXX */
/* This code provided by Rob Zenuk on TSO-REXX on 2015-01-05 */
/* N.B. Rob reports unknown authorship by some earlier poster */
say 'date() --------->' date();
say "date('N',date('J'),'J') -->" date('N',date('J'),'J');
odate = '20150101'
say "date('N',"odate",'S') -->" date('N',odate,'S');
odate = '15001'
say "date('N',"odate",'J') -->" date('N',odate,'J');
say "date('U',date('J'),'J') -->" date('U',date('J'),'J');
say "date('S',date('J'),'J') -->" date('S',date('J'),'J'),
translate('1234/56/78',date('S',date('J'),'J'),'12345678');
say "date('S',date('J'),'J') -->" date('S',date('J'),'J'),
translate('1234-56-78',date('S',date('J'),'J'),'12345678');
say "date('U',date('S'),'S') -->" date('U',date('S'),'S');
say 'date('J') --------->' date('J') translate('12.345',date(j),'12345')
say 'date('C') --------->' date('C');
say 'date('N') --------->' date('N');
MyDate=date('N')
parse upper var MyDate MyDate
say 'UPPER date("N") --->' MyDate
say 'date('W') --------->' date('W');
say 'date('S') --------->' date('S');
today=date('C')
say 'Today is ...............' date('S',today,'C') date('W',today,'C')
say 'Tomorrow is ............' date('S',today+1,'C'),
date('W',today+1,'C')
say 'Yesterday was ..........' date('S',today-1,'C'),
date('W',today-1,'C')
bdate = '19600705'
say 'My birthday.............' bdate date('W',bdate,'S')
say 'Today + 100 days....'date('S',(date('B',date('J'),'J')+100),'B')
say 'Today + 20 days....'date('N',(date('B',date('J'),'J')+20),'B')
say 'Today - 100 days....'date('S',(date('B',date('J'),'J')-100),'B')
say 'Today - 20 days....'date('N',(date('B',date('J'),'J')-20),'B')
say translate('1234-56-78',date(s),'12345678') /* add separators */
say translate('12345678',date(s),'56781234') /* standard to US */
say translate('12-34-5678',date(s),'56781234') /* w/ separators */
say translate('12345678',date(s),'56783412') /* standard to EU */
say translate('12-34-5678',date(s),'56783412') /* w/ separators */
say (date('B')-date('B','00001','J')) 'days since' date('N','00001','J')
say (date('B')-date('B','05035','J')) 'days since' date('N','05035','J')
say 'First day of current month: ' ,
translate('a2345601',date(s),'a23456') /* 1st day of month */
say 'Last day of previous month: ' ,
date(s,date(b,translate('a2345601',date(s),'a23456'),s)-1,b)
say 'DB2 Timestamp format: ', /* DB2 Timestamp */
translate('1234-56-78',date(s),'12345678')||"-"||,
Translate('ab.cd.ef.ghijkl',Time('L'),'ab:cd:ef.ghijkl')
say date('S') time()
sampdate = '2011/04/22'
say sampdate
say space(translate(sampdate,'','/'),0)
say translate(12345678,space(translate(sampdate,'','/'),0),12345678)
say translate('S',space(translate(sampdate,'','/'),0),'N')
say translate('N',space(translate(sampdate,'','/'),0),'S')
EXIT

Here are the results which I got. Note the unexpected results in (at least) the last two expressions.

date() ---------> 5 Jan 2016
date('N',date('J'),'J') --> 5 Jan 2016
date('N',20150101,'S') --> 1 Jan 2015
date('N',15001,'J') --> 1 Jan 2015
date('U',date('J'),'J') --> 01/05/16
date('S',date('J'),'J') --> 20160105 2016/01/05
date('S',date('J'),'J') --> 20160105 2016-01-05
date('U',date('S'),'S') --> 01/05/16
date(J) ---------> 16005 16.005
date(C) ---------> 5849
date(N) ---------> 5 Jan 2016
UPPER date("N") ---> 5 JAN 2016
date(W) ---------> Tuesday
date(S) ---------> 20160105
Today is ............... 20160105 Tuesday
Tomorrow is ............ 20160106 Wednesday
Yesterday was .......... 20160104 Monday
My birthday............. 19600705 Tuesday
Today + 100 days....20160414
Today + 20 days....25 Jan 2016
Today - 100 days....20150927
Today - 20 days....16 Dec 2015
2016-01-05
01052016
01-05-2016
05012016
05-01-2016
5848 days since 1 Jan 2000
3987 days since 4 Feb 2005
First day of current month: 20160101
Last day of previous month: 20151231
DB2 Timestamp format: 2016-01-05-09.47.37.998666
20160105 09:47:37
2011/04/22
20110422
20110422
S
N


--Phil Sevetson
***@fisa.nyc.gov
City of New York / Financial Info Svcs Agcy
New York, NY USA 10001


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Robert Zenuk
Sent: Tuesday, January 05, 2016 9:28 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions

Here is some sample date conversion stuff. Someone posted most of this several years ago (sorry, don't remember who). I have added a few small things of my own as examples over the years. Maybe something in here will help with the general question of date conversions. No Roman Numerals though... <grin>

say 'date() --------->' date();
say "date('N',date('J'),'J') -->" date('N',date('J'),'J'); odate = '20150101'
say "date('N',"odate",'S') -->" date('N',odate,'S'); odate = '15001'
say "date('N',"odate",'J') -->" date('N',odate,'J'); say "date('U',date('J'),'J') -->" date('U',date('J'),'J'); say "date('S',date('J'),'J') -->" date('S',date('J'),'J'),
translate('1234/56/78',date('S',date('J'),'J'),'12345678');
say "date('S',date('J'),'J') -->" date('S',date('J'),'J'),
translate('1234-56-78',date('S',date('J'),'J'),'12345678');
say "date('U',date('S'),'S') -->" date('U',date('S'),'S'); say 'date('J') --------->' date('J') translate('12.345',date(j),'12345')
say 'date('C') --------->' date('C');
say 'date('N') --------->' date('N');
MyDate=date('N')
parse upper var MyDate MyDate
say 'UPPER date("N") --->' MyDate
say 'date('W') --------->' date('W');
say 'date('S') --------->' date('S');
today=date('C')
say 'Today is ...............' date('S',today,'C') date('W',today,'C') say 'Tomorrow is ............' date('S',today+1,'C'),
date('W',today+1,'C')
say 'Yesterday was ..........' date('S',today-1,'C'),
date('W',today-1,'C')
bdate = '19600705'
say 'My birthday.............' bdate date('W',bdate,'S') say 'Today + 100 days....'date('S',(date('B',date('J'),'J')+100),'B')
say 'Today + 20 days....'date('N',(date('B',date('J'),'J')+20),'B')
say 'Today - 100 days....'date('S',(date('B',date('J'),'J')-100),'B')
say 'Today - 20 days....'date('N',(date('B',date('J'),'J')-20),'B')
say translate('1234-56-78',date(s),'12345678') /* add separators */
say translate('12345678',date(s),'56781234') /* standard to US */
say translate('12-34-5678',date(s),'56781234') /* w/ separators */
say translate('12345678',date(s),'56783412') /* standard to EU */
say translate('12-34-5678',date(s),'56783412') /* w/ separators */
say (date('B')-date('B','00001','J')) 'days since' date('N','00001','J') say (date('B')-date('B','05035','J')) 'days since' date('N','05035','J') say 'First day of current month: ' ,
translate('a2345601',date(s),'a23456') /* 1st day of month */
say 'Last day of previous month: ' ,
date(s,date(b,translate('a2345601',date(s),'a23456'),s)-1,b)
say 'DB2 Timestamp format: ', /* DB2 Timestamp */
translate('1234-56-78',date(s),'12345678')||"-"||,
Translate('ab.cd.ef.ghijkl',Time('L'),'ab:cd:ef.ghijkl')
say date('S') time()
sampdate = '2011/04/22'
say sampdate
say space(translate(sampdate,'','/'),0)
say translate(12345678,space(translate(sampdate,'','/'),0),12345678)
say translate('S',space(translate(sampdate,'','/'),0),'N')
say translate('N',space(translate(sampdate,'','/'),0),'S')

Hope this helps,

Rob


-----Original Message-----
From: Zelden, Mark <***@CSC.COM>
To: TSO-REXX <TSO-***@VM.MARIST.EDU>
Sent: Tue, Jan 5, 2016 7:11 am
Subject: Re: Help with Date Conversions


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of John McKown
Sent: Monday, January 04, 2016 7:00 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions
Post by Lizette Koehler
the REXX manuals are somewhat light on how to convert the dates using DATE function.
I have a date of 2016001 and I want to display it as Jan 1, 2016 or
2016 Jan 01
Tell me this is easy with the DATE('N','2016001','s')
​I don't think so. The only format option that I see which accepts a "julian" date​ is "J", and it only accepts a 2 digit year and so is not "general". What I do is something like:

YYYY=LEFT(INPUT_DATE,4)
DDD = RIGHT(INPUT_DATE,3)
/* CONVERT STANDARD FORMAT DATE TO BASE FOR JAN 1 OF YEAR, THEN ADD DAY-IN-YEAR MINUS 1 */
BASEDATE=DATE('B',YYYY||"0101",'S')+DDD-1
/* CONVERT BASE FORMAT TO DAY MON YEAR FORMAT */
OUTPUT=DATE('N',BASEDATE,'B')

Run it all together to be even more incomprehensible

OUTPUT=DATE('N',(DATE('B',LEFT(INPUT_DATE),4)||"0101",'S')+RIGHT(INPUT_DATE,3)-1),'B')
Post by Lizette Koehler
Or do I need to translate the 2016001 to 20160101 first?
​This is what DATE('B',YYYY||"0101",'S')+DDD-1 does​
Post by Lizette Koehler
I also have a date of 2016.001 - same question.
​Same answer as above because with 2016.001 YYYY=2016 and DDD=001 just as above. The period is basically not involved.​
Post by Lizette Koehler
Lastly, is there any doc someone wrote on how to use the DATE function
in REXX better? I seem to be doing a lot of trial with many errors.
​Not that I know of. I'm just used to doing weird things in many different languages.​ You _don't_ want to look at my PERL or APL!
Post by Lizette Koehler
:(
Thanks
Lizette
Prior to OS/390 2.4, the TSO/E REXX DATE function didn't even do conversions. I wrote RDATE for that
reason and still use it often. You may find it helpful. It's embedded in some of my public execs like
IPLINFO, but it's also on my web site and CBT file 434 as a stand alone exec.

Cheers,

Mark
--

Mark's MVS Utilities: http://www.mzelden.com/mvsutil.html

CSC - This is a PRIVATE message - If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind the Company to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2016-01-05 15:46:58 UTC
Permalink
Raw Message
Post by Sevetson, Phil
By the time the list manager got through with it, some of your code was concatenated and some was repaginated so that some lines went beyond 72 characters,
...
What's the problem with "beyond 72 characters"? I have no problem with Rexx
as wide as my terminal screen, often 132 characters.
Post by Sevetson, Phil
and some SAY verbs were on the same line as others, without intervening semicolons. I'm going to try to reformat and see if I can get the list manager to honor CRLF/Newline/Whatever. If this fails, I'll put a text file up on Dropbox for a few days and post the link here.
It's rarely the "list manager" but often the submitter's editor, MUA, or MTA.
Don't post from a word processor -- they often enforce "smart quotes", break or
flow lines at hyphens, italicize at slashes, and misconstrue "=" as a Q-P
escape. One of the most reliable things to do is to post from a LISTSERV
web interface.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Richards, Robert B.
2016-01-05 15:53:44 UTC
Permalink
Raw Message
My suggestion:

Do a REPLY, change the text you want to cut and paste to COURIER NEW.

A quick look at the lines indicated that the "say" statements could be moved to a new line.

Paste into FB80, add a /* REXX */ card and execute.

Voila! Works like a charm.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Tuesday, January 05, 2016 10:47 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions
Post by Sevetson, Phil
By the time the list manager got through with it, some of your code was concatenated and some was repaginated so that some lines went beyond 72 characters,
...
What's the problem with "beyond 72 characters"? I have no problem with Rexx as wide as my terminal screen, often 132 characters.
Post by Sevetson, Phil
and some SAY verbs were on the same line as others, without intervening semicolons. I'm going to try to reformat and see if I can get the list manager to honor CRLF/Newline/Whatever. If this fails, I'll put a text file up on Dropbox for a few days and post the link here.
It's rarely the "list manager" but often the submitter's editor, MUA, or MTA.
Don't post from a word processor -- they often enforce "smart quotes", break or flow lines at hyphens, italicize at slashes, and misconstrue "=" as a Q-P escape. One of the most reliable things to do is to post from a LISTSERV web interface.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU<mailto:***@VM.MARIST.EDU> with the message: INFO TSO-REXX


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Sevetson, Phil
2016-01-05 15:55:32 UTC
Permalink
Raw Message
Paul, I can only speak for myself -- sometimes, it's more convenient to stream the REXX inside the JCL. That's a 72-character line. And my REXX source code is stored in 72-character (80-character) datasets, and my Attachmate session can give me 3270-mod-4 or 3270-mod-5, and I choose mod-4 because I can see more lines of the JCL with which I do most of my productive work.

In the matter of submitting by a web interface, I'll keep it in mind for future code samples -- it didn't occur to me, and TSO-REXX arrives in my mailbox, so I thought first of a mailed reply.

--Phil Sevetson
***@fisa.nyc.gov
City of New York / Financial Info Svcs Agcy
New York, NY USA 10001


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Tuesday, January 05, 2016 10:47 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions
Post by Sevetson, Phil
By the time the list manager got through with it, some of your code was concatenated and some was repaginated so that some lines went beyond 72 characters,
...
What's the problem with "beyond 72 characters"? I have no problem with Rexx as wide as my terminal screen, often 132 characters.
Post by Sevetson, Phil
and some SAY verbs were on the same line as others, without intervening semicolons. I'm going to try to reformat and see if I can get the list manager to honor CRLF/Newline/Whatever. If this fails, I'll put a text file up on Dropbox for a few days and post the link here.
It's rarely the "list manager" but often the submitter's editor, MUA, or MTA.
Don't post from a word processor -- they often enforce "smart quotes", break or flow lines at hyphens, italicize at slashes, and misconstrue "=" as a Q-P escape. One of the most reliable things to do is to post from a LISTSERV web interface.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Styles, Andy , SD EP zPlatform
2016-01-05 16:09:07 UTC
Permalink
Raw Message
Didn't someone recently try an sending an attachment out (I've attached something here)? That seems a reasonable way to retain formatting - notwithstanding ASCII/EBCDIC and other conversions.
--
Andy Styles


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Sevetson, Phil
Sent: 05 January 2016 15:54
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions

-- This email has reached the Bank via an external source --


Paul, I can only speak for myself -- sometimes, it's more convenient to stream the REXX inside the JCL. That's a 72-character line. And my REXX source code is stored in 72-character (80-character) datasets, and my Attachmate session can give me 3270-mod-4 or 3270-mod-5, and I choose mod-4 because I can see more lines of the JCL with which I do most of my productive work.

In the matter of submitting by a web interface, I'll keep it in mind for future code samples -- it didn't occur to me, and TSO-REXX arrives in my mailbox, so I thought first of a mailed reply.

--Phil Sevetson
***@fisa.nyc.gov
City of New York / Financial Info Svcs Agcy New York, NY USA 10001


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Tuesday, January 05, 2016 10:47 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions
Post by Sevetson, Phil
By the time the list manager got through with it, some of your code was concatenated and some was repaginated so that some lines went beyond 72 characters,
...
What's the problem with "beyond 72 characters"? I have no problem with Rexx as wide as my terminal screen, often 132 characters.
Post by Sevetson, Phil
and some SAY verbs were on the same line as others, without intervening semicolons. I'm going to try to reformat and see if I can get the list manager to honor CRLF/Newline/Whatever. If this fails, I'll put a text file up on Dropbox for a few days and post the link here.
It's rarely the "list manager" but often the submitter's editor, MUA, or MTA.
Don't post from a word processor -- they often enforce "smart quotes", break or flow lines at hyphens, italicize at slashes, and misconstrue "=" as a Q-P escape. One of the most reliable things to do is to post from a LISTSERV web interface.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX



Lloyds Banking Group plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in Scotland no. SC95000. Telephone: 0131 225 4555. Lloyds Bank plc. Registered Office: 25 Gresham Street, London EC2V 7HN. Registered in England and Wales no. 2065. Telephone 0207626 1500. Bank of Scotland plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in Scotland no. SC327000. Telephone: 03457 801 801. Cheltenham & Gloucester plc. Registered Office: Barnett Way, Gloucester GL4 3RL. Registered in England and Wales 2299428. Telephone: 0345 603 1637

Lloyds Bank plc, Bank of Scotland plc are authorised by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and Prudential Regulation Authority.

Cheltenham & Gloucester plc is authorised and regulated by the Financial Conduct Authority.

Halifax is a division of Bank of Scotland plc. Cheltenham & Gloucester Savings is a division of Lloyds Bank plc.

HBOS plc. Registered Office: The Mound, Edinburgh EH1 1YZ. Registered in Scotland no. SC218813.

This e-mail (including any attachments) is private and confidential and may contain privileged material. If you have received this e-mail in error, please notify the sender and delete it (including any attachments) immediately. You must not copy, distribute, disclose or use any of the information in it or any attachments. Telephone calls may be monitored or recorded.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2016-01-05 16:11:17 UTC
Permalink
Raw Message
Paul, I can only speak for myself -- sometimes, it's more convenient to stream the REXX inside the JCL. That's a 72-character line. ...
At least 80. And easily even more.
And my REXX source code is stored in 72-character (80-character) datasets, ...
I used to do that, but I got better. My SYSEXEC is 'recfm(V,B) lrecl(299)',
unrealistically large, just in case. And I keep much Rexx in UNIX files
where LRECL is meaningless.
and my Attachmate session can give me 3270-mod-4 or 3270-mod-5, and I choose mod-4 because I can see more lines of the JCL with which I do most of my productive work.
I routinely use 44x132 and get both. But I'm not afflicted by Attachmate.
In the matter of submitting by a web interface, I'll keep it in mind for future code samples -- it didn't occur to me, and TSO-REXX arrives in my mailbox, so I thought first of a mailed reply.
Perhaps you can dumb down your mailer; disable the fancy features;
edit in a monospaced font, etc. (It's only trying to help you.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Ken MacKenzie
2016-01-05 14:46:59 UTC
Permalink
Raw Message
Very similar but different ...

/* Get input date or current date */
If Arg() = 1 Then
Parse Arg 1 cc 3 yy 5 mm 7 dd 9 .
Else
Parse Value(Date(S)) With 1 cc 3 yy 5 mm 7 dd 9 .

bdate = Date(B, yy'/01/01', O) /* Establish Jan 1st (base)
*/
tdate = Date(B, yy'/'mm'/'dd, O) /* Establish today(base) */

days = Right(tdate - bdate + 1, 3, 0) /* calculate days this year
*/
Say cc || yy || days

/* Or, as Mark says, make it incomprehensible */
Say cc || yy || Right(Date(B, yy'/'mm'/'dd, O) - Date(B, yy'/01/01', O)
+ 1, 3, 0)


Ken MacKenzie
Pramerica Systems Ireland Limited
is a private company limited by shares
incorporated and registered in the Republic of Ireland with registered
number 319900
and registered office at 6th Floor, South Bank House, Barrow Street,
Dublin 4, Ireland.




From: "Zelden, Mark" <***@CSC.COM>
To: TSO-***@VM.MARIST.EDU,
Date: 05/01/2016 14:20
Subject: Re: [TSO-REXX] Help with Date Conversions
Sent by: TSO REXX Discussion List <TSO-***@VM.MARIST.EDU>




-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of John McKown
Sent: Monday, January 04, 2016 7:00 PM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Help with Date Conversions
Post by Lizette Koehler
the REXX manuals are somewhat light on how to convert the dates using DATE function.
I have a date of 2016001 and I want to display it as Jan 1, 2016 or
2016
Post by Lizette Koehler
Jan 01
Tell me this is easy with the DATE('N','2016001','s')
​I don't think so. The only format option that I see which accepts a
"julian" date​ is "J", and it only accepts a 2 digit year and so is not
"general". What I do is something like:

YYYY=LEFT(INPUT_DATE,4)
DDD = RIGHT(INPUT_DATE,3)
/* CONVERT STANDARD FORMAT DATE TO BASE FOR JAN 1 OF YEAR, THEN ADD
DAY-IN-YEAR MINUS 1 */
BASEDATE=DATE('B',YYYY||"0101",'S')+DDD-1
/* CONVERT BASE FORMAT TO DAY MON YEAR FORMAT */
OUTPUT=DATE('N',BASEDATE,'B')

Run it all together to be even more incomprehensible

OUTPUT=DATE('N',(DATE('B',LEFT(INPUT_DATE),4)||"0101",'S')+RIGHT(INPUT_DATE,3)-1),'B')
Post by Lizette Koehler
Or do I need to translate the 2016001 to 20160101 first?
​This is what DATE('B',YYYY||"0101",'S')+DDD-1 does​
Post by Lizette Koehler
I also have a date of 2016.001 - same question.
​Same answer as above because with 2016.001 YYYY=2016 and DDD=001 just as
above. The period is basically not involved.​
Post by Lizette Koehler
Lastly, is there any doc someone wrote on how to use the DATE function
in REXX better? I seem to be doing a lot of trial with many errors.
​Not that I know of. I'm just used to doing weird things in many
different languages.​ You _don't_ want to look at my PERL or APL!
Post by Lizette Koehler
:(
Thanks
Lizette
Prior to OS/390 2.4, the TSO/E REXX DATE function didn't even do
conversions. I wrote RDATE for that
reason and still use it often. You may find it helpful. It's embedded
in some of my public execs like
IPLINFO, but it's also on my web site and CBT file 434 as a stand alone
exec.

Cheers,

Mark
--

Mark's MVS Utilities: http://www.mzelden.com/mvsutil.html

CSC - This is a PRIVATE message - If you are not the intended recipient,
please delete without copying and kindly advise us by e-mail of the
mistake in delivery. NOTE: Regardless of content, this e-mail shall not
operate to bind the Company to any order or other contract unless pursuant
to explicit written agreement or government initiative expressly
permitting the use of e-mail for such purpose.
Farley, Peter x23353
2016-01-05 16:07:37 UTC
Permalink
Raw Message
I accidentally sent this to Lizette directly yesterday, resending to the list for the archives.

For Rexx statements:

say date('N', substr('2016001',3), 'J')
say date(, substr('2016001',3), 'J')

Tested output on a z/OS V2.1 system is:

1 Jan 2016
1 Jan 2016

The disadvantage of this simpler solution of course is that it only handles years in the current century. If your input is in past or future centuries you have to be more creative to convert the Rexx Julian format (YY only) to a format that handles 4-digit years, explicitly or implicitly.

Peter

-----Original Message-----
From: Farley, Peter x23353
Sent: Monday, January 04, 2016 7:44 PM
To: 'Lizette Koehler'
Subject: RE: Help with Date Conversions

Output_date_std = date('N', substr('2016001',3), 'J')

Or alternatively (since 'N' is the default output format):

Output_date_std = date(,substr('2016001',3), 'J')

Will give you '01 Jan 2016', which you can parse and rearrange as you need.

The DATE function first parameter is the output format, the input format is argument 3 ('J' is for "Julian as yyddd" so you have to strip the century from it).

URL to the bookie page for DATE in Rexx:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4A3A0/4.3.16?SHELF=ikj4bkc0&DT=20110621111559

Does that help?

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Lizette Koehler
Sent: Monday, January 04, 2016 7:16 PM
To: TSO-***@VM.MARIST.EDU
Subject: Help with Date Conversions

the REXX manuals are somewhat light on how to convert the dates using DATE function.

I have a date of 2016001 and I want to display it as Jan 1, 2016 or 2016 Jan 01

Tell me this is easy with the DATE('N','2016001','s')

Or do I need to translate the 2016001 to 20160101 first?

I also have a date of 2016.001 - same question.

Lastly, is there any doc someone wrote on how to use the DATE function in REXX better? I seem to be doing a lot of trial with many errors.

:(

Thanks

Lizette
--


This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
Paul Gilmartin
2016-01-05 16:14:14 UTC
Permalink
Raw Message
Post by Farley, Peter x23353
The disadvantage of this simpler solution of course is that it only handles years in the current century. If your input is in past or future centuries you have to be more creative to convert the Rexx Julian format (YY only) to a format that handles 4-digit years, explicitly or implicitly.
Weren't these problems supposed to be fixed, 15 years ago?

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Farley, Peter x23353
2016-01-05 16:26:22 UTC
Permalink
Raw Message
Not in TSO Rexx, at any rate. TSO Rexx still defines Julian format as YYDDD, and AFAIK TSO Rexx has no year-windowing facility.

Mark Zelden's RDATE routine handles Julian as YYYYDDD, (e.g., result = rdatef(1996,300) ) so that is an alternative way to convert YYYYDDD to TSO Rexx "Standard" format YYYYMMDD (with some parsing of the rdatef output), which can then be converted to TSO Rexx "Normal" format.

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Tuesday, January 05, 2016 11:14 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: Help with Date Conversions
Post by Farley, Peter x23353
The disadvantage of this simpler solution of course is that it only handles years in the current century. If your input is in past or future centuries you have to be more creative to convert the Rexx Julian format (YY only) to a format that handles 4-digit years, explicitly or implicitly.
Weren't these problems supposed to be fixed, 15 years ago?

--

This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Grinsell, Don
2016-01-05 16:28:39 UTC
Permalink
Raw Message
There's a century window on the input dates:

Input dates given in 2-digit year formats (i.e. European, Julian,
Ordered, Usa) are interpreted as being within a 100 year window as
calculated by:

(current_year - 50) = low end of window
(current_year + 49) = high end of window

say date('N',substr('1966001',3),'J')
say date('N',substr('1965001',3),'J')

1 Jan 1966
1 Jan 2065

So if you aren't concerned with dates from 50 years ago, this should be fine.

--

Donald Grinsell
State of Montana
406-444-2983
***@mt.gov

"This is a war of the unknown warriors; but let all strive without failing in faith or duty..."
~ Winston Churchill
Post by Zelden, Mark
-----Original Message-----
Behalf Of Farley, Peter x23353
Sent: Tuesday, January 05, 2016 9:06 AM
Subject: Re: [TSO-REXX] Help with Date Conversions
I accidentally sent this to Lizette directly yesterday, resending to the list for
the archives.
say date('N', substr('2016001',3), 'J')
say date(, substr('2016001',3), 'J')
1 Jan 2016
1 Jan 2016
The disadvantage of this simpler solution of course is that it only handles
years in the current century. If your input is in past or future centuries you
have to be more creative to convert the Rexx Julian format (YY only) to a
format that handles 4-digit years, explicitly or implicitly.
Peter
-----Original Message-----
From: Farley, Peter x23353
Sent: Monday, January 04, 2016 7:44 PM
To: 'Lizette Koehler'
Subject: RE: Help with Date Conversions
Output_date_std = date('N', substr('2016001',3), 'J')
Output_date_std = date(,substr('2016001',3), 'J')
Will give you '01 Jan 2016', which you can parse and rearrange as you need.
The DATE function first parameter is the output format, the input format is
argument 3 ('J' is for "Julian as yyddd" so you have to strip the century from
it).
http://publibz.boulder.ibm.com/cgi-
bin/bookmgr_OS390/BOOKS/IKJ4A3A0/4.3.16?SHELF=ikj4bkc0&DT=20110621
111559
Does that help?
Peter
-----Original Message-----
Sent: Monday, January 04, 2016 7:16 PM
Subject: Help with Date Conversions
the REXX manuals are somewhat light on how to convert the dates using DATE function.
I have a date of 2016001 and I want to display it as Jan 1, 2016 or 2016 Jan 01
Tell me this is easy with the DATE('N','2016001','s')
Or do I need to translate the 2016001 to 20160101 first?
I also have a date of 2016.001 - same question.
Lastly, is there any doc someone wrote on how to use the DATE function in
REXX better? I seem to be doing a lot of trial with many errors.
:(
Thanks
Lizette
--
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential. If
the reader of the message is not the intended recipient or an authorized
representative of the intended recipient, you are hereby notified that any
dissemination of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by e-mail
and delete the message and any attachments from your system.
Farley, Peter x23353
2016-01-05 16:35:53 UTC
Permalink
Raw Message
Well, you learn something new every day. I missed seeing that note on the Rexx Date function page (it's down near the bottom of the page).

Thank you!

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Grinsell, Don
Sent: Tuesday, January 05, 2016 11:28 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: Help with Date Conversions

There's a century window on the input dates:

Input dates given in 2-digit year formats (i.e. European, Julian,
Ordered, Usa) are interpreted as being within a 100 year window as
calculated by:

(current_year - 50) = low end of window
(current_year + 49) = high end of window

say date('N',substr('1966001',3),'J')
say date('N',substr('1965001',3),'J')

1 Jan 1966
1 Jan 2065

So if you aren't concerned with dates from 50 years ago, this should be fine.

--


This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
Martin Dunkel
2016-01-05 16:51:56 UTC
Permalink
Raw Message
Rexers,

Let me jump in here just for a minute because I am not sure the original
question was answered. If someone already answered this question, sorry,
I didn't read through every email...

In Rexx, to convert Julian dates to other date formats, there is no date
formula to do this directly. So, what I generally do is to just convert
the Julian date to a Base date format, then in a separate statement,
convert the Base date format to whatever format I want.

Simple program:

/* Rexx */
dt_j='05005'
say dt_j

dt_b=date("B",dt_j,"J")
say dt_b

dt_u=date("U",dt_b,"B")
say dt_u

exit 0

Output:

05005
731950
01/05/05
***

Later... MPD

Martin Dunkel
Technology Infrastructure Services
Change Management

PNC Financial
Cleveland Ops Ctr-North,West,S
4100 W 150th St, Mail Stop: B7-YB17-02-1
Cleveland, OH 44135

(p) 216.257.5354 | (c) 440.822.8178
***@pnc.com




From: "Farley, Peter x23353" <***@BROADRIDGE.COM>
To: TSO-***@VM.MARIST.EDU,
Date: 01/05/2016 11:37 AM
Subject: Re: [TSO-REXX] Help with Date Conversions
Sent by: TSO REXX Discussion List <TSO-***@VM.MARIST.EDU>



Well, you learn something new every day. I missed seeing that note on the
Rexx Date function page (it's down near the bottom of the page).

Thank you!

Peter

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf
Of Grinsell, Don
Sent: Tuesday, January 05, 2016 11:28 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: Help with Date Conversions

There's a century window on the input dates:

Input dates given in 2-digit year formats (i.e. European, Julian,
Ordered, Usa) are interpreted as being within a 100 year window as
calculated by:

(current_year - 50) = low end of window
(current_year + 49) = high end of window

say date('N',substr('1966001',3),'J')
say date('N',substr('1965001',3),'J')

1 Jan 1966
1 Jan 2065

So if you aren't concerned with dates from 50 years ago, this should be
fine.

--


This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the message is not the intended recipient or an
authorized representative of the intended recipient, you are hereby
notified that any dissemination of this communication is strictly
prohibited. If you have received this communication in error, please
notify us immediately by e-mail and delete the message and any attachments
from your system.



The contents of this email are the property of PNC. If it was not addressed to you, you have no legal right to read it. If you think you received it in error, please notify the sender. Do not forward or copy without permission of the sender. This message may be considered a commercial electronic message under Canadian law or this message may contain an advertisement of a product or service and thus may constitute a commercial electronic mail message under US law. You may unsubscribe at any time from receiving commercial electronic messages from PNC at http://pages.e.pnc.com/globalunsub/
PNC, 249 Fifth Avenue, Pittsburgh, PA 15222; pnc.com



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Marco Gianfranco Indaco
2016-01-05 17:51:11 UTC
Permalink
Raw Message
Sorry, in this way the Julian date 00.060 will change in 2051 (51.001),
right?
Post by Martin Dunkel
Rexers,
Let me jump in here just for a minute because I am not sure the original
question was answered. If someone already answered this question, sorry,
I didn't read through every email...
In Rexx, to convert Julian dates to other date formats, there is no date
formula to do this directly. So, what I generally do is to just convert
the Julian date to a Base date format, then in a separate statement,
convert the Base date format to whatever format I want.
/* Rexx */
dt_j='05005'
say dt_j
dt_b=date("B",dt_j,"J")
say dt_b
dt_u=date("U",dt_b,"B")
say dt_u
exit 0
05005
731950
01/05/05
***
Later... MPD
Martin Dunkel
Technology Infrastructure Services
Change Management
PNC Financial
Cleveland Ops Ctr-North,West,S
4100 W 150th St, Mail Stop: B7-YB17-02-1
Cleveland, OH 44135
(p) 216.257.5354 | (c) 440.822.8178
Date: 01/05/2016 11:37 AM
Subject: Re: [TSO-REXX] Help with Date Conversions
Well, you learn something new every day. I missed seeing that note on the
Rexx Date function page (it's down near the bottom of the page).
Thank you!
Peter
-----Original Message-----
Sent: Tuesday, January 05, 2016 11:28 AM
Subject: Re: Help with Date Conversions
Input dates given in 2-digit year formats (i.e. European, Julian,
Ordered, Usa) are interpreted as being within a 100 year window as
(current_year - 50) = low end of window
(current_year + 49) = high end of window
say date('N',substr('1966001',3),'J')
say date('N',substr('1965001',3),'J')
1 Jan 1966
1 Jan 2065
So if you aren't concerned with dates from 50 years ago, this should be fine.
--
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the message is not the intended recipient or an
authorized representative of the intended recipient, you are hereby
notified that any dissemination of this communication is strictly
prohibited. If you have received this communication in error, please
notify us immediately by e-mail and delete the message and any attachments
from your system.
The contents of this email are the property of PNC. If it was not
addressed to you, you have no legal right to read it. If you think you
received it in error, please notify the sender. Do not forward or copy
without permission of the sender. This message may be considered a
commercial electronic message under Canadian law or this message may
contain an advertisement of a product or service and thus may constitute a
commercial electronic mail message under US law. You may unsubscribe at any
time from receiving commercial electronic messages from PNC at
http://pages.e.pnc.com/globalunsub/
PNC, 249 Fifth Avenue, Pittsburgh, PA 15222; pnc.com
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2016-01-05 17:58:53 UTC
Permalink
Raw Message
Post by Marco Gianfranco Indaco
Sorry, in this way the Julian date 00.060 will change in 2051 (51.001),
right?
Alas, I believe so.

That concerns me less than the challenge of living until 2051.

People have already forgotten the lessons they should have learned
16 years ago.

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Martin Dunkel
2016-01-05 19:33:41 UTC
Permalink
Raw Message
Marco,

I was addressing the original question in this thread. The yy century
window had already been discussed, so I didn't think that needed to be
answered again. The Rexx Julian date format is yyddd and we are to live
by that. If one is not satisfied with way Rexx handles the moving yy
century window, then one will need to code additional logic around that.

Martin Dunkel
Technology Infrastructure Services
Change Management

PNC Financial
Cleveland Ops Ctr-North,West,S
4100 W 150th St, Mail Stop: B7-YB17-02-1
Cleveland, OH 44135

(p) 216.257.5354 | (c) 440.822.8178
***@pnc.com




From: Marco Gianfranco Indaco <***@GMAIL.COM>
To: TSO-***@VM.MARIST.EDU,
Date: 01/05/2016 12:52 PM
Subject: Re: [TSO-REXX] Help with Date Conversions
Sent by: TSO REXX Discussion List <TSO-***@VM.MARIST.EDU>



Sorry, in this way the Julian date 00.060 will change in 2051 (51.001),
right?
Post by Martin Dunkel
Rexers,
Let me jump in here just for a minute because I am not sure the original
question was answered. If someone already answered this question, sorry,
I didn't read through every email...
In Rexx, to convert Julian dates to other date formats, there is no date
formula to do this directly. So, what I generally do is to just convert
the Julian date to a Base date format, then in a separate statement,
convert the Base date format to whatever format I want.
/* Rexx */
dt_j='05005'
say dt_j
dt_b=date("B",dt_j,"J")
say dt_b
dt_u=date("U",dt_b,"B")
say dt_u
exit 0
05005
731950
01/05/05
***
Later... MPD
Martin Dunkel
Technology Infrastructure Services
Change Management
PNC Financial
Cleveland Ops Ctr-North,West,S
4100 W 150th St, Mail Stop: B7-YB17-02-1
Cleveland, OH 44135
(p) 216.257.5354 | (c) 440.822.8178
Date: 01/05/2016 11:37 AM
Subject: Re: [TSO-REXX] Help with Date Conversions
Well, you learn something new every day. I missed seeing that note on the
Rexx Date function page (it's down near the bottom of the page).
Thank you!
Peter
-----Original Message-----
Sent: Tuesday, January 05, 2016 11:28 AM
Subject: Re: Help with Date Conversions
Input dates given in 2-digit year formats (i.e. European, Julian,
Ordered, Usa) are interpreted as being within a 100 year window as
(current_year - 50) = low end of window
(current_year + 49) = high end of window
say date('N',substr('1966001',3),'J')
say date('N',substr('1965001',3),'J')
1 Jan 1966
1 Jan 2065
So if you aren't concerned with dates from 50 years ago, this should be fine.
--
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and
confidential.
Post by Martin Dunkel
If the reader of the message is not the intended recipient or an
authorized representative of the intended recipient, you are hereby
notified that any dissemination of this communication is strictly
prohibited. If you have received this communication in error, please
notify us immediately by e-mail and delete the message and any
attachments
Post by Martin Dunkel
from your system.
The contents of this email are the property of PNC. If it was not
addressed to you, you have no legal right to read it. If you think you
received it in error, please notify the sender. Do not forward or copy
without permission of the sender. This message may be considered a
commercial electronic message under Canadian law or this message may
contain an advertisement of a product or service and thus may constitute a
commercial electronic mail message under US law. You may unsubscribe at any
time from receiving commercial electronic messages from PNC at
http://pages.e.pnc.com/globalunsub/
PNC, 249 Fifth Avenue, Pittsburgh, PA 15222; pnc.com
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX



The contents of this email are the property of PNC. If it was not addressed to you, you have no legal right to read it. If you think you received it in error, please notify the sender. Do not forward or copy without permission of the sender. This message may be considered a commercial electronic message under Canadian law or this message may contain an advertisement of a product or service and thus may constitute a commercial electronic mail message under US law. You may unsubscribe at any time from receiving commercial electronic messages from PNC at http://pages.e.pnc.com/globalunsub/
PNC, 249 Fifth Avenue, Pittsburgh, PA 15222; pnc.com



----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Robert Zenuk
2016-01-06 01:49:32 UTC
Permalink
Raw Message
Here is some working code...

/* rexx - convert YYYYJJJ or YYYY.JJJ to MMM DD, YYYY or YYYY MMM DD */
say cd(2016001)
say cd(2016.001)
exit 0
cd: O = date('N',right(space(translate(arg(1),' ','.'),0),5),'J')
parse var O DD MMM YYYY
return arg(1) '=>' O '=>' MMM DD',' YYYY 'or' YYYY MMM right(DD,2,0)


Output:

2016001 => 1 Jan 2016 => Jan 1, 2016 or 2016 Jan 01
2016.001 => 1 Jan 2016 => Jan 1, 2016 or 2016 Jan 01


Rob


-----Original Message-----
From: Lizette Koehler <***@MINDSPRING.COM>
To: TSO-REXX <TSO-***@VM.MARIST.EDU>
Sent: Mon, Jan 4, 2016 5:16 pm
Subject: Help with Date Conversions

the REXX manuals are somewhat light on how to convert the dates using DATE function.

I have a date of 2016001 and I want to display it as Jan 1, 2016 or 2016 Jan 01

Tell me this is easy with the DATE('N','2016001','s')

Or do I need to translate the 2016001 to 20160101 first?

I also have a date of 2016.001 - same question.

Lastly, is there any doc someone wrote on how to use the DATE function in REXX better? I seem to be doing a lot of trial with many errors.

:(

Thanks

Lizette

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Loading...