looking for xmisc.xdate

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

looking for xmisc.xdate

kenner
<base href="x-msg://8415/">

I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

measel
<base href="x-msg://8415/">

fd = SimpleDateFormat("E")  /* day of the week */

dt = fd.format(Date())

 

adjust as necessary.

From: [hidden email] [mailto:[hidden email]] On Behalf Of Kenneth Klein (TEMA TPC)
Sent: Wednesday, April 17, 2013 12:42 PM
To: IBM Netrexx
Subject: [Ibm-netrexx] looking for xmisc.xdate

 

I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

alansam
In reply to this post by kenner
You're probably better off using the Java java.util.Calendar and java.util.DateFormat classes.

There are some examples in Rosetta Code too: http://rosettacode.org/wiki/Day_of_the_week#NetRexx

A.


On 17 April 2013 10:41, Kenneth Klein (TEMA TPC) <[hidden email]> wrote:

I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/





--
Can't tweet, won't tweet!

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Alan

--
Needs more cowbell.
Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

kenner
In reply to this post by measel
<base href="x-msg://8415/">

Am I not importing the correct classes?:

 

import java.util.Date

import java.text.DateFormat

 

class DateDemo public 

 

    method main(args) static

            parm = string 'EEE'

        fd = SimpleDateFormat(parm)  /* day of the week */

        dt = fd.format(Date())

        say dt

 

C:\Users\KEKLEIN\REXX\NetRexx\bjcpe  Wed 04/17/2013 15:59:56.93

> java -Dnrx.compiler=ecj org.netrexx.process.NetRexxC DateDemo.nrx        

NetRexx portable processor, version NetRexx 3.02, build 11-20130323-1551

Copyright (c) RexxLA, 2011,2013.  All rights reserved.

Parts Copyright (c) IBM Corporation, 1995,2008.

Program DateDemo.nrx

  === class DateDemo ===

    function main(Rexx)

  8 +++         fd = SimpleDateFormat(parm)  /* day of the week */

    +++              ^^^^^^^^^^^^^^^^

    +++ Error: The method 'SimpleDateFormat(java.lang.String)' cannot be found in class 'DateDemo' or a superclass

Compilation of 'DateDemo.nrx' failed [one error]

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Measel, Mike
Sent: Wednesday, April 17, 2013 1:56 PM
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] looking for xmisc.xdate

 

fd = SimpleDateFormat("E")  /* day of the week */

dt = fd.format(Date())

 

adjust as necessary.

From: [hidden email] [[hidden email]] On Behalf Of Kenneth Klein (TEMA TPC)
Sent: Wednesday, April 17, 2013 12:42 PM
To: IBM Netrexx
Subject: [Ibm-netrexx] looking for xmisc.xdate

 

I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

alansam
You need to import java.util.SimpleDateFormat.  java.util.DateFormat is more flexible but requires more work on your part.  SimpleDateFormat is simpler to use :-)

You could overcome the issue by using:

import java.util.

but it brings in way more than you normally need so it is preferable to be explicit but it comes at the cost of more typing.

A.



On 17 April 2013 13:07, Kenneth Klein (TEMA TPC) <[hidden email]> wrote:

Am I not importing the correct classes?:

 

import java.util.Date

import java.text.DateFormat

 

class DateDemo public 

 

    method main(args) static

            parm = string 'EEE'

        fd = SimpleDateFormat(parm)  /* day of the week */

        dt = fd.format(Date())

        say dt

 

C:\Users\KEKLEIN\REXX\NetRexx\bjcpe  Wed 04/17/2013 15:59:56.93

> java -Dnrx.compiler=ecj org.netrexx.process.NetRexxC DateDemo.nrx        

NetRexx portable processor, version NetRexx 3.02, build 11-20130323-1551

Copyright (c) RexxLA, 2011,2013.  All rights reserved.

Parts Copyright (c) IBM Corporation, 1995,2008.

Program DateDemo.nrx

  === class DateDemo ===

    function main(Rexx)

  8 +++         fd = SimpleDateFormat(parm)  /* day of the week */

    +++              ^^^^^^^^^^^^^^^^

    +++ Error: The method 'SimpleDateFormat(java.lang.String)' cannot be found in class 'DateDemo' or a superclass

Compilation of 'DateDemo.nrx' failed [one error]

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Measel, Mike
Sent: Wednesday, April 17, 2013 1:56 PM
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] looking for xmisc.xdate

 

fd = SimpleDateFormat("E")  /* day of the week */

dt = fd.format(Date())

 

adjust as necessary.

From: [hidden email] [[hidden email]] On Behalf Of Kenneth Klein (TEMA TPC)
Sent: Wednesday, April 17, 2013 12:42 PM
To: IBM Netrexx
Subject: [Ibm-netrexx] looking for xmisc.xdate

 

I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/





--
Can't tweet, won't tweet!

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Alan

--
Needs more cowbell.
Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

measel
In reply to this post by kenner
<base href="x-msg://8415/">

Hey Kenneth, in addition to the import that Alan mentioned, I think you are misunderstanding the call. 

The “parm” value of “EEE” would be Wednesday,Wednesday, Wednesday.  The parm you want to pass is to Date() if not today.  The simpledateformat takes the argument of how you want the output format.

 

Parm = “4/16/2013”

fd = SimpleDateFormat("E")  /* day of the week */

dt = fd.format(Date(Parm))

say dt

“Tuesday”

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Kenneth Klein (TEMA TPC)
Sent: Wednesday, April 17, 2013 3:08 PM
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] looking for xmisc.xdate

 

Am I not importing the correct classes?:

 

import java.util.Date

import java.text.DateFormat

 

class DateDemo public 

 

    method main(args) static

            parm = string 'EEE'

        fd = SimpleDateFormat(parm)  /* day of the week */

        dt = fd.format(Date())

        say dt

 

C:\Users\KEKLEIN\REXX\NetRexx\bjcpe  Wed 04/17/2013 15:59:56.93

> java -Dnrx.compiler=ecj org.netrexx.process.NetRexxC DateDemo.nrx        

NetRexx portable processor, version NetRexx 3.02, build 11-20130323-1551

Copyright (c) RexxLA, 2011,2013.  All rights reserved.

Parts Copyright (c) IBM Corporation, 1995,2008.

Program DateDemo.nrx

  === class DateDemo ===

    function main(Rexx)

  8 +++         fd = SimpleDateFormat(parm)  /* day of the week */

    +++              ^^^^^^^^^^^^^^^^

    +++ Error: The method 'SimpleDateFormat(java.lang.String)' cannot be found in class 'DateDemo' or a superclass

Compilation of 'DateDemo.nrx' failed [one error]

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Measel, Mike
Sent: Wednesday, April 17, 2013 1:56 PM
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] looking for xmisc.xdate

 

fd = SimpleDateFormat("E")  /* day of the week */

dt = fd.format(Date())

 

adjust as necessary.

From: [hidden email] [[hidden email]] On Behalf Of Kenneth Klein (TEMA TPC)
Sent: Wednesday, April 17, 2013 12:42 PM
To: IBM Netrexx
Subject: [Ibm-netrexx] looking for xmisc.xdate

 

I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

kenner
In reply to this post by alansam

This is finally what worked for me:

 

import java.util.Date

import java.text.

import java.text.DateFormat

import java.text.SimpleDateFormat

 

class DateDemo public 

 

    method main(s=String[]) static

            Parm = '4/16/2013'

            fd = SimpleDateFormat("E")  /* day of the week */

            dt = fd.format(Date(Parm))

            say dt

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Alan Sampson
Sent: Wednesday, April 17, 2013 4:21 PM
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] looking for xmisc.xdate

 

You need to import java.util.SimpleDateFormat.  java.util.DateFormat is more flexible but requires more work on your part.  SimpleDateFormat is simpler to use :-)

 

You could overcome the issue by using:

 

import java.util.

 

but it brings in way more than you normally need so it is preferable to be explicit but it comes at the cost of more typing.

 

A.

 

 

On 17 April 2013 13:07, Kenneth Klein (TEMA TPC) <[hidden email]> wrote:

Am I not importing the correct classes?:

 

import java.util.Date

import java.text.DateFormat

 

class DateDemo public 

 

    method main(args) static

            parm = string 'EEE'

        fd = SimpleDateFormat(parm)  /* day of the week */

        dt = fd.format(Date())

        say dt

 

C:\Users\KEKLEIN\REXX\NetRexx\bjcpe  Wed 04/17/2013 15:59:56.93

> java -Dnrx.compiler=ecj org.netrexx.process.NetRexxC DateDemo.nrx        

NetRexx portable processor, version NetRexx 3.02, build 11-20130323-1551

Copyright (c) RexxLA, 2011,2013.  All rights reserved.

Parts Copyright (c) IBM Corporation, 1995,2008.

Program DateDemo.nrx

  === class DateDemo ===

    function main(Rexx)

  8 +++         fd = SimpleDateFormat(parm)  /* day of the week */

    +++              ^^^^^^^^^^^^^^^^

    +++ Error: The method 'SimpleDateFormat(java.lang.String)' cannot be found in class 'DateDemo' or a superclass

Compilation of 'DateDemo.nrx' failed [one error]

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Measel, Mike
Sent: Wednesday, April 17, 2013 1:56 PM
To: IBM Netrexx
Subject: Re: [Ibm-netrexx] looking for xmisc.xdate

 

fd = SimpleDateFormat("E")  /* day of the week */

dt = fd.format(Date())

 

adjust as necessary.

From: [hidden email] [[hidden email]] On Behalf Of Kenneth Klein (TEMA TPC)
Sent: Wednesday, April 17, 2013 12:42 PM
To: IBM Netrexx
Subject: [Ibm-netrexx] looking for xmisc.xdate

 

I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



 

--
Can't tweet, won't tweet!


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

Tom Maynard

On 04/18/2013 12:33 PM, Kenneth Klein (TEMA TPC) wrote:

This is finally what worked for me:

It's only marginally successful on my system:

Program DateDemo.nrx
  === class DateDemo ===
    function main(String[])
 10 +++     dt = fd.format(Date(Parm))
    +++                    ^^^^
    +++ Warning: The constructor 'Date(String)' has been deprecated
Note: /home/tom/netrexx/DateDemo.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Compilation of 'DateDemo.nrx' successful [one warning]

But your javac may be different from mine (1.7.0_15).


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

Robert L Hamilton
In reply to this post by kenner
In each 400 day section of the Gregorian day number, each day number evenly divisible by 7 is a Sunday, as I remember.
 
BOBH

On Wed, Apr 17, 2013 at 12:41 PM, Kenneth Klein (TEMA TPC) <[hidden email]> wrote:

I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/




_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

Jerry McBride
In reply to this post by kenner
On 04/17/13 13:41, Kenneth Klein (TEMA TPC) wrote:
> I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?
>
>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>


Ken,

Yup... that's what I use. If the attachment is stripped contact me off list.



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


xmisc.nrx (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

alansam
It didn't compile.  It needs the xmath package too.  I've come across this before. It appears that the NetRexx tutorial (http://www.netrexx.org/Tutorial/nr_1.html) has become disconnected from it's source code.

A.


On 18 April 2013 17:20, Jerry McBride <[hidden email]> wrote:
On 04/17/13 13:41, Kenneth Klein (TEMA TPC) wrote:
I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



Ken,

Yup... that's what I use. If the attachment is stripped contact me off list.



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/





--
Can't tweet, won't tweet!

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Alan

--
Needs more cowbell.
Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

rvjansen
I added the xclasses.jar file to the tools page on netrexx.org.

The tutorial itself needs some work before I can link to it again. It looks very dated and sometimes sent people in the wrong direction. I hope someone can invest some time into it.

best regards,

René.

On 19 apr. 2013, at 03:41, Alan Sampson <[hidden email]> wrote:

It didn't compile.  It needs the xmath package too.  I've come across this before. It appears that the NetRexx tutorial (http://www.netrexx.org/Tutorial/nr_1.html) has become disconnected from it's source code.

A.


On 18 April 2013 17:20, Jerry McBride <[hidden email]> wrote:
On 04/17/13 13:41, Kenneth Klein (TEMA TPC) wrote:
I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



Ken,

Yup... that's what I use. If the attachment is stripped contact me off list.



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/





--
Can't tweet, won't tweet!
_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: looking for xmisc.xdate

Jerry McBride
In reply to this post by alansam
So sorry. Here is the complete package in source.





On 04/18/13 21:41, Alan Sampson wrote:

> It didn't compile.  It needs the xmath package too.  I've come across this
> before. It appears that the NetRexx tutorial (
> http://www.netrexx.org/Tutorial/nr_1.html) has become disconnected from
> it's source code.
>
> A.
>
>
> On 18 April 2013 17:20, Jerry McBride <[hidden email]> wrote:
>
>> On 04/17/13 13:41, Kenneth Klein (TEMA TPC) wrote:
>>
>>> I want to use a date function to tell which day of the week a date is. Is
>>> this the best class to use and where can I find it?
>>>
>>>
>>>
>>> ______________________________**_________________
>>> Ibm-netrexx mailing list
>>> [hidden email]
>>> Online Archive : http://ibm-netrexx.215625.n3.**nabble.com/<http://ibm-netrexx.215625.n3.nabble.com/>
>>>
>>>
>>
>> Ken,
>>
>> Yup... that's what I use. If the attachment is stripped contact me off
>> list.
>>
>>
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>>
>>
>>
>
>
>
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/


pmatcht.nrx (1K) Download Attachment
xarray.nrx (8K) Download Attachment
xcmdline.nrx (4K) Download Attachment
xconfig.nrx (3K) Download Attachment
xdir.nrx (7K) Download Attachment
xfile.nrx (13K) Download Attachment
xftp.nrx (11K) Download Attachment
xhistory.nrx (3K) Download Attachment
xinfoline.nrx (1K) Download Attachment
xinterpret.nrx (5K) Download Attachment
xmath.nrx (8K) Download Attachment
xmisc.nrx (17K) Download Attachment
xpager.nrx (5K) Download Attachment
xserv.nrx (5K) Download Attachment
xsock.nrx (6K) Download Attachment
xstring.nrx (11K) Download Attachment
xsys.nrx (6K) Download Attachment
xtimer.nrx (3K) Download Attachment
xurl.nrx (13K) Download Attachment