× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Thanks Scott
MUCH appreciated
Brian Johnson had previously pointed me in the right direction as far as
the format of and length of the parameters were concerned, but then I was
sat here thinking
How do I get a timestamp from this?
Like I said in my original e-mail
My brain hurts
Like I said before
Sometimes I dismay myself


Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill




Scott Klement
<rpg400-l@scottkl
ement.com> To
Sent by: RPG programming on the IBM i /
rpg400-l-bounces@ System i <rpg400-l@xxxxxxxxxxxx>
midrange.com cc

Subject
05/20/2010 02:38 Re: Creating a time stamp from a
PM command


Please respond to
RPG programming
on the IBM i /
System i
<rpg400-l@midrang
e.com>






Hi Alan,

The TYPE(*DATE) and TYPE(*TIME) options in the command interface do
allow the date/time in various formats... however, it's important to
understand that they normalize the output.

In other words... even though a user might key 05/20/2010 or 05202010 or
052010 in to the command, the parameter passed to your program will
_always_ be in CYYMMDD format, i.e. 1100520. Always.

Same with time... the parameter passed to your program is always HHMMSS,
separators are removed, etc.

So to convert this to an RPG timestamp is really very simple:

/free
MyTimeStamp = %date( cmdDate : *cymd0 )
+ %time( cmdTime : *hms0 );

Since the command normalizes it, there's no need to account for
different variations. It really makes life easy.

On 5/20/2010 12:40 PM, Alan Shore wrote:

Afternoon everyone
I believe I am on the correct list, and it will become apparent as you
read
my e-mail

To coin an old Monty Python phrase
"My brain hurts"
I am attempting to create a command

CMD PROMPT(' ')

PARM KWD(SCREENUSER) TYPE(*CHAR) LEN(10) MIN(1) +
PROMPT('User Profile:')
PARM KWD(FROMDATE) TYPE(*DATE) MIN(1) +
PROMPT('From Date:')
PARM KWD(FROMTIME) TYPE(*TIME) MIN(1) +
PROMPT('From Time:')
PARM KWD(THRUDATE) TYPE(*DATE) MIN(1) +
PROMPT('Thru Date:')
PARM KWD(THRUTIME) TYPE(*TIME) MIN(1) +
PROMPT('Thru Time:')

That accepts a user profile name, a From date, a From time, a Thru date
and
a Thru time

I created the command and when I place values into the different fields
this is what I find
For the date fields, it recognizes invalid dates, but the valid dates can
be entered in the following formats
02/28/10
022810
02/28/2010
02282010

The time fields recognize invalid times, but the valid times can be
entered
in the following formats

050000
0500
05:00:00
05:00

My problem is that within the RPGILE program to process the command, I
need to take both the From date& time (and the Thru date and time) and
create timestamps and for some reason my mind becomes blank
I am hoping someone has done this already and can point me in the right
direction

As always all answers gratefully accepted


Thanks in advance

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.