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.