• Re: how can convert string to numeric with Query/400

    From Tom Black@21:1/5 to CRPence on Tue Oct 5 10:40:25 2021
    On Thursday, October 11, 2012 at 12:15:43 PM UTC-5, CRPence wrote:
    On 25 Sep 2012 08:58, tun...@gmail.com wrote:
    On Friday, August 20, 1999 3:00:00 AM UTC-4, Kevin Buckley wrote:
    There is a way to do it
    <<SNIP daft but functional though limited conversion ref\xmp>>

    Ufuk Ă–zdemir<uf...@singer.com.tr> wrote in message

    How can convert string to numeric with Query/400?
    I want to convert string value to numeric value is it possible
    with query/400 like DIGITS operator or other is it possible

    This is not an answer for the question, but I wanted to share my
    comment on this. How can IBM become a worldwide leader while not
    providing such a simple conversion function to its users? It is a
    piece of toy for even the most simple development tools since 20-30
    years ago. Isn't it strange for you too? IBM never deserved to be a
    world leader with its software solutions. Very primitive tools.
    Excuse me IBM, I am earning my life thanks to my AS/400 skills but,
    you should make this job easier for your customers.
    The NewsServer I use never had the original message nor the 20-Aug
    reply, so I will reply to this message.

    Not strange to me at all. The Query/400 was designed to replace the Query/36; a carryover until various SQL tooling could replace the simple report writer and mail\merge features provided by the Query/400. The QM Query facility [STRQM CL command] is tooling for SQL [including query reporting] that can replace most usages of the Query/400. Use of the Query/400 tooling had long been deprecated; at least since the
    availability of QMQRY for which RTVQMQRY and STRQMQRY CL commands [both
    with ALWQRYDFN(*ONLY), and the ANZQRY CL command] were made available
    over 20 years ago to assist a transition to locally stored [not client-based; e.g. via ODBC] SQL queries. A *QMQRY object could be
    created to perform the request the OP expressed as desired effect.

    However note that an SQL VIEW has long been able to effect the
    requested conversion [asked of in the original message], and the
    Query/400 query definition has always been able reference [to query] an
    SQL VIEW as a Query Input Database File (QRYFILE parameter). The
    database file would be named either on the RUNQRY or on the "Specify
    file selections" of the WRKQRY command [or its equivalent, QRYRUN or QRY
    in the S/36EE]. Depending on the requirements, the expression to define
    the VIEW column [or QM query report column] might be as simple as using
    the DECIMAL cast function:
    DECIMAL(string_fld, 10, 2)

    Regards, Chuck
    That's a ton of work and shouldn't be necessary for quick development, miss you man.
    Tom Black

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)