day today - as400

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
noamp
Posts: 15
Joined: Thu Nov 02, 2017 9:29 pm

day today - as400

Post by noamp »

Hey everyone.
i using lansa on ibm i (as400) - i want to use in my program with the day ,
i need to know what day is it- if its sunday(1) or wednesday(2) on go on like that.
if someone know how to do that? thanks!
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: day today - as400

Post by jyoung »

If you already have the date and it is a date type, you can you the AsDayOfWeek Intristic function.

http://docs.lansa.com/14/en/lansa016/pr ... ofweek.htm

If you don't have a date already the below works well for me.

Not at my PC so I winging this on my phone.

Code: Select all

#today := (*YYYYMMDD).AsDate(CCYYMMDD).AsDayOfWeek(SYMBOL)
noamp
Posts: 15
Joined: Thu Nov 02, 2017 9:29 pm

Re: day today - as400

Post by noamp »

hey, thanks for the help buy it is not on as400. the functions in lansa pc or what ever you using on is another commands from the ibm i (as400) commands. but thanks.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: day today - as400

Post by atostaine »

That code jyoung posted is RDMLX. That works on VL.
Art Tostaine
Post Reply