× 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 Simon, but this does not fully address the issue.

By using *JOB as the from-format on CVTDAT, I'm forcing users to adhere to a
stricter date format than OS/400 allows. For a job date format of *MDY,
users can successfully present *MDY, *MDY/, *MDYY, *MDYY/ formatted dates to
the prompter; all four date formats are passed through to the CPP.

On my system, the job date format is *MDY.

Command:

Cmd prompt('Pass a date')
Parm kwd(mydate) type(*date) min(1) prompt('Date')


CPP (CLP):

Pgm parm(&mydate)
Dcl var(&mydate) type(*char) len(7)
Dmpclpgm
Endpgm


CPP (REXX):

Address command
Parse arg 'MYDATE(' mydate ')'
Cymddate = 'xxxxxxx'
"cvtdat date("mydate") tovar(&cymddate)",
   "fromfmt(*job) tofmt(*cymd) tosep(*none)"
If 'xxxxxxx' = cymddate | '0' <> rc then,
   "sndpgmmsg msg('Date conversion error.')"
Say mydate "," cymddate
Exit(0)


Results (job date format *MDY, input for 4 October 2005):

Command      CLP       REXX
100405       1051004   100405 , 1051004
10/04/05     1051004   '10/04/05' , 1051004
10042005     1051004   10042005 , xxxxxxx     (CPF0553 received)
10/04/2005   1051004   '10/04/2005' , xxxxxxx     (CPF0553 received)


CPF0553: Date contains too many or too few numeric characters.

Program-based CPPs receive more help from the system in terms of parameter
conversion than REXX-based CPPs.

The most expedient way to resolve this problem and be fair to my users is to
use a command/CL combination.

Thanks,
Loyd

Loyd Goodbar
Senior programmer/analyst
BorgWarner
E/TS Water Valley
662-473-5713
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Simon Coulter
Sent: Monday, October 03, 2005 23:50
To: Midrange Systems Technical Discussion
Subject: Re: REXX and dates from commands



So very simple Rexx code can be used to handle the date regardless of 
input format. For example:


This will work regardless of the job date format.

Regards,
Simon Coulter.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.