×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




There are shops with "legacy" data that might have something like this...

Say the file name in question is XFiles, and the field name is XFieldNum.

****  Method One: 

Insert a MONITOR before using the field, and an ENDMON just after, but before 
the ENDMON use ON-ERROR to check for an error on the field.


****  Method Two: 

a.Determine the start-position of the culprit field in the record format.
b.Define an externally described data structure in the D-specs.
c.Define another character subfield of length 9 for the externally described 
data structure, and use OVERLAY(FieldPosn) to overlay it to the culprit field 
to test.
d.In the RPG code, test against the overlaid character subfield. 

D XFilesDS    E  DS   Extname( XFiles )
D   xFieldCh           Overlay( XFieldNum )


****  Method Three: 

a.Define a pointer and initialize it to the field address, and then a define a 
character field of 9 long based on that pointer:

D XFieldNumPointer   S     *   inz(%addr( XFieldNum ) 
D XFieldChar         S     *   based( XFieldNumPointer )

===> In your code you can use xFieldCH in the first case, or XFieldChar in the 
second, to test for blanks before using the numeric field. 

--Alan



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Jay Vaughn
Sent: Wednesday, October 18, 2006 4:44 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: blank or 0 in database field


We have a PF with a field defined 9s0...

A non-as/400 application moves data to that field and according to the 
programmer, it is either 0 or blank... 

Is there a way to determine in my rpg pgm whether he moved a 0 or blank to 
that field?
 


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