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



I totally agree!!!

michael




"Holden Tommy" <Tommy.Holden@xxxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/18/2007 10:39 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: SQL, fetch & decimal data error






<snip> I have a field defined as packed and some of the records have
*Blanks in this field. When I FETCH, I get a DDE. Can I code around
this? If so, how? Short of fixing the data and the pgms that
write/update this file (S36), what are my options? </snip>

I never understood why people did this....packed value of 0 takes up the
same space as packed blanks...and is a valid number! Anytime I have
come across this (and it's happened several times to me) is find the
program(s) that are loading the frigging blanks and slug a zero
value...then I do a quick and dirty to update the file to remove the
packed blanks...it's far better to fix the problem that to find ways to
"work around" or ignore it...JMO


Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
MKirkpatrick@xxxxxxxxxxxxxxxxx
Sent: Friday, May 18, 2007 12:28 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: SQL, fetch & decimal data error

Pete,

I tried your solution with the Null indicator but I still get the
Decimal
Data Error.




Pete Helgren <Pete@xxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/17/2007 11:19 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: SQL, fetch & decimal data error






Use and null indicator on your SQL statement and it will handle the
error for you by setting on the null indicator (which you could ignore
or use for further processing).

I coded my SQL like this (covering ALL the bases):

C/EXEC SQL

C+ FETCH FROM C2 INTO :DocID :N1,:Asset :N2,:LineNum :N3,

C+ :DescID :N4,:Desc :N5,:AcqDate :N6,:PONum :N7,

C+ :POLine :N8,:VendNum :N9,:Invoice :N10,:AcqMethod :N11,

C+ :Condition :N12,:Cost :N13, :Account :N14

C/END-EXEC


Null indicators in the D specs are like this:

//Null indicator fields

D N1 S 5I 0


Pete Helgren


MKirkpatrick@xxxxxxxxxxxxxxxxx wrote:
I am using SQL to read a file. I use an Ext DS for the fields in the
file. I have a field defined as packed and some of the records have
*Blanks in this field. When I FETCH, I get a DDE. Can I code around
this? If so, how? Short of fixing the data and the pgms that
write/update this file (S36), what are my options? Thanks.





This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are

addressed. Unless you are the addressee (or authorized to receive for
the
addressee), you may not use, copy or disclose to anyone this email or
any
information contained in this email. If you have received this email in

error, please advise the sender by replying to this email, and delete
this
email immediately. Please note that any views or opinions presented in
this email are solely those of the author and do not necessarily
represent
those of Western Dental Services, Inc. Finally, the recipient should
check this email and any attachments for the presence of viruses.
Western
Dental Services, Inc. accepts no liability for any damage caused by any
virus transmitted by this email.


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.