× 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.



In SQL you can use TRIM, In RPGLE %trim

Kind regards,

Carel Teijgeler


Op 24-4-2019 om 14:06 schreef Steinmetz, Paul via MIDRANGE-L:
Alan,

My issue is that the current alpha field is left justified with trailing blanks.
Not converting well.

Paul

-----Original Message-----
From: Alan Shore [mailto:ashore@xxxxxxxx]
Sent: Wednesday, April 24, 2019 8:00 AM
To: Midrange Systems Technical Discussion
Cc: Steinmetz, Paul
Subject: RE: Alpha to Numeric converion issue

Hi Paul
For SQL use decimal(field, 5, 0)
For RPG use %dec(field:5:0)

Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Steinmetz, Paul via MIDRANGE-L
Sent: Wednesday, April 24, 2019 7:56 AM
To: 'midrange-l@xxxxxxxxxxxxxxxxxx' <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: Steinmetz, Paul <PSteinmetz@xxxxxxxxxx>
Subject: [EXTERNAL] Alpha to Numeric converion issue

I'm extracting a value from source code.
The values range from "1 " to "99999", 5 alpha field.

I need the end result in a numeric field, 5.0 zoned decimal acceptable, packed preferred.
"00001" "99999".

Current process is within an AS/400 query.
SQL or custom RPGLE program our options.

Any thoughts from the group?

Thank You
_____
Paul Steinmetz
IBM i Systems Administrator

Pencor Services, Inc.
462 Delaware Ave
Palmerton Pa 18071

610-826-9117 work
610-826-9188 fax
610-349-0913 cell
610-377-6012 home

psteinmetz@xxxxxxxxxx
http://www.pencor.com/







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.