Re: REXX Date Function Help...Please
You can, however, convert a date to the number of days so far in the year, "D". Here is a little Exec that I have to convert any specified Isodate into a "Julian" type date, with a four digit year. I have anothe r Exec that converts a specified Julian date to an Isodate. (Handy for those of us that have to deal with z/OS systems, since they love Julian dates.) /**/ /*I2J */ /* Exec to Convert IsoDate (-mm-dd) to Julian Date (/ddd).*/ /**/ I2J: Arg isodate . If isodate = '' Then isodate = Date('S',,,'-') Parse Var isodate '-' . Say isodate '=' '/'Right(Date('D',isodate,'S',,'-'),3,'0') Exit 0 /**/ /*J2I */ /* Exec to Convert Julian Date (yyddd) to IsoDate (-mm-dd). */ /**/ J2I: Arg juldate . If juldate = '' Then juldate = Date('J') Say juldate '=' Date('S',juldate,'J','-') Exit 0 -- Dale R. Smith "Qui non intelligit aut discat aut taceat" On Wed, 13 May 2009 10:33:12 -0700, Howard Rifkind wrote: >Thanks all, > >I'm sure from one of these suggestions I'll be able to find a solution t o the problem I'm working on.
Re: REXX Date Function Help...Please
Thanks all, I'm sure from one of these suggestions I'll be able to find a solution to the problem I'm working on. --- On Wed, 5/13/09, Scott Rohling wrote: From: Scott Rohling Subject: Re: REXX Date Function Help...Please To: IBMVM@LISTSERV.UARK.EDU Date: Wednesday, May 13, 2009, 12:14 PM Yes - I agree - the point is to phase out Julian. I think phasing out 'USA' (or European) is harder because it's used as a 'shorthand' date so many places. I suggested to Howard offline that using DATE('B') (Base) is probably the best way to deal with date manipulation (the common reason for using Julian) and doesn't have the difficulties of spanning years that Julian does when doing calculations. For example: today = date('B') lastweek = today - 7 Say DATE('S', lastweek, 'B') Would spit out the the sorted date (mmdd) for one week ago. This works whether I issue it on Jan 2 or Jun 2. Scott On Wed, May 13, 2009 at 10:05 AM, Ethan Lanz wrote: so it looks like the point is phasing out Julian dates.
Re: REXX Date Function Help...Please
Yes - I agree - the point is to phase out Julian. I think phasing out 'USA' (or European) is harder because it's used as a 'shorthand' date so many places. I suggested to Howard offline that using DATE('B') (Base) is probably the best way to deal with date manipulation (the common reason for using Julian) and doesn't have the difficulties of spanning years that Julian does when doing calculations. For example: today = date('B') lastweek = today - 7 Say DATE('S', lastweek, 'B') Would spit out the the sorted date (mmdd) for one week ago. This works whether I issue it on Jan 2 or Jun 2. Scott On Wed, May 13, 2009 at 10:05 AM, Ethan Lanz wrote: > > > so it looks like the point is phasing out Julian dates. > >
Re: REXX Date Function Help...Please
On Wed, May 13, 2009 at 11:38 AM, Chip Davis wrote: > Yes, that was the intention of the ANSI Standard Committee's Y2K work. It > is not possible to convert from any of the ambiguous date formats. What > should Date('U', 'Tuesday', 'W') return? > > Since the Julian format was defined to have only a two-digit year (yynnn) > there is no way to define an accurate equivalent date. And yes, we > discussed sliding windows and a number of other hacks and ultimately > rejected them as dangerous. One could get the wrong answer and not know it. > We like the 'astonishment factor' to stay as low as possible. > > Besides, as Bob has shown, there are several ways of accomplishing the > conversion as long as you know the century the Julian date belongs to. > > -Chip- > However, date('S','04/05/09','U') returns '20090405' consistent with: 2. Input dates given in 2-digit year formats 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 so it looks like the point is phasing out Julian dates. > > On 5/13/09 14:02 Edward M Martin said: > >> Hello Howard, >> >> >> From z/VM 5.3 Help REXX DATE >> >> >> >> >>> >--DATE(--.---.--.-.--)--->< >>> >> >> |(1)| '-| Group 1 |-' >> '-output_date_format' >> >> And then reference (1) >> >> Has >> >> NOTE: >> (1) If the Century or Julian format is specified, then no other options >> >> are permitted. These two formats are provided for compatibility with >> >> programs written for releases prior to VM/ESA(R) version 2 release >> 1.1. It is recommended that they not be used for new programs. >> >> It would seem that if you specify Julian format you have to use today’s >> date. >> >> >> Ed Martin >> >> Aultman Health Foundation >> >> 330-363-5050 >> >> ext 35050 >> >>
Re: REXX Date Function Help...Please
Yes, that was the intention of the ANSI Standard Committee's Y2K work. It is not possible to convert from any of the ambiguous date formats. What should Date('U', 'Tuesday', 'W') return? Since the Julian format was defined to have only a two-digit year (yynnn) there is no way to define an accurate equivalent date. And yes, we discussed sliding windows and a number of other hacks and ultimately rejected them as dangerous. One could get the wrong answer and not know it. We like the 'astonishment factor' to stay as low as possible. Besides, as Bob has shown, there are several ways of accomplishing the conversion as long as you know the century the Julian date belongs to. -Chip- On 5/13/09 14:02 Edward M Martin said: Hello Howard, From z/VM 5.3 Help REXX DATE >--DATE(--.---.--.-.--)--->< |(1)| '-| Group 1 |-' '-output_date_format' And then reference (1) Has NOTE: (1) If the Century or Julian format is specified, then no other options are permitted. These two formats are provided for compatibility with programs written for releases prior to VM/ESA(R) version 2 release 1.1. It is recommended that they not be used for new programs. It would seem that if you specify Julian format you have to use today’s date. Ed Martin Aultman Health Foundation 330-363-5050 ext 35050 *From:* The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] *On Behalf Of *Scott Rohling *Sent:* Tuesday, May 12, 2009 10:05 PM *To:* IBMVM@LISTSERV.UARK.EDU *Subject:* Re: REXX Date Function Help...Please For the group (sent this to Howard personally when I did a reply): Is this what you mean?: jday = date('J') Say DATE('U',jday,'J') On DATE: the first parm is the output format (USA) - the 2nd is the input date - the 3rd is the input date format. Scott On Tue, May 12, 2009 at 7:57 PM, Howard Rifkind <mailto:vmes...@yahoo.com>> wrote: I have the DATE function working in order to get the current date into Julian date format but I'm have difficulty going the other way...Julian date to standard date such as MM/DD/YY. I've tried tries a number of ways to format the DATE function to do this without any success. I surrender. File_Juldate = DATE('J',FILE_DATE)Doesn't work. Any help with this will be appreciated. Thanks
Re: REXX Date Function Help...Please
I had trouble manipulating Julian dates for a product wrapper I wrote; finally wrote something like this, that you can modify to get the answer you're looking for: /* * J2N EXEC * * Display a Julian date in Normal format; this is really pretty * easy, but it's become such a common need that I wrote a routine * * It was SO easy, I've updated it to handle forms like nnn and * .nnn and others that happen to fit. The translate() call * changes single quotes, slashes and decimal points to blanks, and * the space() call removes all blanks from in and around the string. * Then take only the last 5 characters, prepending zeros if needed. */ arg JDate .; JDate = space(translate(JDate,,"'/."), 0); JDate = right(JDate, 5, "0"); say date("W", JDate, "J")"," date(, JDate, "J"); and then: j2n E08143 returns: Thursday, 22 May 2008 R; From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On Behalf Of Edward M Martin Sent: Wednesday, May 13, 2009 10:03 AM To: IBMVM@listserv.uark.edu Subject: Re: REXX Date Function Help...Please Hello Howard, >From z/VM 5.3 Help REXX DATE >>--DATE(--.---.--.-.--)---> < |(1)| '-| Group 1 |-' '-output_date_format' And then reference (1) Has NOTE: (1) If the Century or Julian format is specified, then no other options are permitted. These two formats are provided for compatibility with programs written for releases prior to VM/ESA(R) version 2 release 1.1. It is recommended that they not be used for new programs. It would seem that if you specify Julian format you have to use today's date. Ed Martin Aultman Health Foundation 330-363-5050 ext 35050 From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On Behalf Of Scott Rohling Sent: Tuesday, May 12, 2009 10:05 PM To: IBMVM@LISTSERV.UARK.EDU Subject: Re: REXX Date Function Help...Please For the group (sent this to Howard personally when I did a reply): Is this what you mean?: jday = date('J') Say DATE('U',jday,'J') On DATE: the first parm is the output format (USA) - the 2nd is the input date - the 3rd is the input date format. Scott On Tue, May 12, 2009 at 7:57 PM, Howard Rifkind wrote: I have the DATE function working in order to get the current date into Julian date format but I'm have difficulty going the other way...Julian date to standard date such as MM/DD/YY. I've tried tries a number of ways to format the DATE function to do this without any success. I surrender. File_Juldate = DATE('J',FILE_DATE)Doesn't work. Any help with this will be appreciated. Thanks
Re: REXX Date Function Help...Please
Conversion from Julian works: calc date('U','09001','J') date('U','09001','J') = 01/01/09 but conversion to Julian does not: calc date('J','01/01/09','U') "date('J','01/01/09','U')" resulted in REXX error 40: Incorrect call to routine The PIPE DATECONV stage doesn't have these restrictions: pipe literal 01/01/09|dateconv rexx_date_u rexx_date_j|cons 09001 Mark Wheeler http://www.linkedin.com/in/marklwheeler Date: Wed, 13 May 2009 10:02:54 -0400 From: emar...@aultman.com Subject: Re: REXX Date Function Help...Please To: IBMVM@LISTSERV.UARK.EDU Hello Howard, >From z/VM 5.3 Help REXX DATE >>--DATE(--.---.--.-.--)--->< |(1)| '-| Group 1 |-' '-output_date_format' And then reference (1) Has NOTE: (1) If the Century or Julian format is specified, then no other options are permitted. These two formats are provided for compatibility with programs written for releases prior to VM/ESA(R) version 2 release 1.1. It is recommended that they not be used for new programs. It would seem that if you specify Julian format you have to use today’s date. Ed Martin Aultman Health Foundation 330-363-5050 ext 35050 From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On Behalf Of Scott Rohling Sent: Tuesday, May 12, 2009 10:05 PM To: IBMVM@LISTSERV.UARK.EDU Subject: Re: REXX Date Function Help...Please For the group (sent this to Howard personally when I did a reply): Is this what you mean?: jday = date('J') Say DATE('U',jday,'J') On DATE: the first parm is the output format (USA) - the 2nd is the input date - the 3rd is the input date format. Scott On Tue, May 12, 2009 at 7:57 PM, Howard Rifkind wrote: I have the DATE function working in order to get the current date into Julian date format but I'm have difficulty going the other way...Julian date to standard date such as MM/DD/YY. I've tried tries a number of ways to format the DATE function to do this without any success. I surrender. File_Juldate = DATE('J',FILE_DATE)Doesn't work. Any help with this will be appreciated. Thanks _ Hotmail® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009
Re: REXX Date Function Help...Please
Hello Howard, >From z/VM 5.3 Help REXX DATE >>--DATE(--.---.--.-.--)---> < |(1)| '-| Group 1 |-' '-output_date_format' And then reference (1) Has NOTE: (1) If the Century or Julian format is specified, then no other options are permitted. These two formats are provided for compatibility with programs written for releases prior to VM/ESA(R) version 2 release 1.1. It is recommended that they not be used for new programs. It would seem that if you specify Julian format you have to use today's date. Ed Martin Aultman Health Foundation 330-363-5050 ext 35050 From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On Behalf Of Scott Rohling Sent: Tuesday, May 12, 2009 10:05 PM To: IBMVM@LISTSERV.UARK.EDU Subject: Re: REXX Date Function Help...Please For the group (sent this to Howard personally when I did a reply): Is this what you mean?: jday = date('J') Say DATE('U',jday,'J') On DATE: the first parm is the output format (USA) - the 2nd is the input date - the 3rd is the input date format. Scott On Tue, May 12, 2009 at 7:57 PM, Howard Rifkind wrote: I have the DATE function working in order to get the current date into Julian date format but I'm have difficulty going the other way...Julian date to standard date such as MM/DD/YY. I've tried tries a number of ways to format the DATE function to do this without any success. I surrender. File_Juldate = DATE('J',FILE_DATE)Doesn't work. Any help with this will be appreciated. Thanks
Re: REXX Date Function Help...Please
For the group (sent this to Howard personally when I did a reply): Is this what you mean?: jday = date('J') Say DATE('U',jday,'J') On DATE: the first parm is the output format (USA) - the 2nd is the input date - the 3rd is the input date format. Scott On Tue, May 12, 2009 at 7:57 PM, Howard Rifkind wrote: > I have the DATE function working in order to get the current date into > Julian date format but I'm have difficulty going the other way...Julian date > to standard date such as MM/DD/YY. > > I've tried tries a number of ways to format the DATE function to do this > without any success. > > I surrender. > > File_Juldate = DATE('J',FILE_DATE)Doesn't work. > > Any help with this will be appreciated. > > Thanks > >
REXX Date Function Help...Please
I have the DATE function working in order to get the current date into Julian date format but I'm have difficulty going the other way...Julian date to standard date such as MM/DD/YY. I've tried tries a number of ways to format the DATE function to do this without any success. I surrender. File_Juldate = DATE('J',FILE_DATE) Doesn't work. Any help with this will be appreciated. Thanks