Re: RPG ILE with NULL fields
Jack wrote:[color=blue]
> HI,
>
> My RPG ILE app (under V5R2M0) has to "talk" with a Java app. On the
> Java side, they're used to work with NULL fields. And they're expecting
> me to return them NULL fields via parameters.
>
> I do know fields in database can be NULL-capable fields. The thing,
> though, is how can I define a working field to be NULL-capable.
>
> I have to do that because instead of returning a blank field from the
> database, the Java guys would rather like me to return a Null string...
> and we don't want to change the same fields in the DB to be
> NULL-capable...
>
> Thx
>
> Jack[/color]
Without being able to provide an example, if you want to return a null
string then you would probably have to define the string as a pointer
variable type and if returning as a null you would:
MyJavaString = *Null;
HTH,
Jonas
Re: RPG ILE with NULL fields
Have you tried the BIF %nullind ? eval flda = %nullind("null value")
Jack wrote:[color=blue]
> HI,
>
> My RPG ILE app (under V5R2M0) has to "talk" with a Java app. On the
> Java side, they're used to work with NULL fields. And they're expecting
> me to return them NULL fields via parameters.
>
> I do know fields in database can be NULL-capable fields. The thing,
> though, is how can I define a working field to be NULL-capable.
>
> I have to do that because instead of returning a blank field from the
> database, the Java guys would rather like me to return a Null string...
> and we don't want to change the same fields in the DB to be
> NULL-capable...
>
> Thx
>
> Jack[/color]
Re: RPG ILE with NULL fields
Have you tried the BIF %nullind ? eval flda = %nullind("null value")
Jack wrote:[color=blue]
> HI,
>
> My RPG ILE app (under V5R2M0) has to "talk" with a Java app. On the
> Java side, they're used to work with NULL fields. And they're expecting
> me to return them NULL fields via parameters.
>
> I do know fields in database can be NULL-capable fields. The thing,
> though, is how can I define a working field to be NULL-capable.
>
> I have to do that because instead of returning a blank field from the
> database, the Java guys would rather like me to return a Null string...
> and we don't want to change the same fields in the DB to be
> NULL-capable...
>
> Thx
>
> Jack[/color]
Re: RPG ILE with NULL fields
Also, a NULL is simple X'00' character. It works pretty well here, and is
a very simple soultion. ;) -Paul
In <1165018001.908302.77490@f1g2000cwa.googlegroups.com>, on 12/01/06
at 04:06 PM, [email]david.anderson@encompassgroup.net[/email] said:
[color=blue]
>Have you tried the BIF %nullind ? eval flda = %nullind("null value")[/color]
[color=blue]
>Jack wrote:[color=green]
>> HI,
>>
>> My RPG ILE app (under V5R2M0) has to "talk" with a Java app. On the
>> Java side, they're used to work with NULL fields. And they're expecting
>> me to return them NULL fields via parameters.
>>
>> I do know fields in database can be NULL-capable fields. The thing,
>> though, is how can I define a working field to be NULL-capable.
>>
>> I have to do that because instead of returning a blank field from the
>> database, the Java guys would rather like me to return a Null string...
>> and we don't want to change the same fields in the DB to be
>> NULL-capable...
>>
>> Thx
>>
>> Jack[/color][/color]
--
-----------------------------------------------------------
[email]Paul@Raulresons.com[/email]
-----------------------------------------------------------
Re: RPG ILE with NULL fields
Note that I believe there is a difference between null indicators and
what we traditionally have considered a field to be null (i.e. null
pointer). They are not the same in my mind as a null indicator is
similar to a field defined as VARYING - there is a space at the
beginning of the field to store the current length of the variable. I
would think the same would be true here, but I could be wrong. I
checked the %NULLIND bif in the RPG manual but it didn't clarify to
that level of detail.
In your case (i.e. Java objects) I would imagine it is more in the vein
of null pointers. I believe the null indicators came about because of
null support in DB2 (again, fuzzy information) and RPG programmer's
need to utilize these fields.
HTH,
Aaron Bartell
[url]http://mowyourlawn.com[/url]
Re: RPG ILE with NULL fields
On Sat, Dec 02, 2006 at 05:33:35PM -0600, [email]Paul-NO-SPAM@Raulersons.com[/email] wrote:[color=blue]
> Also, a NULL is simple X'00' character. It works pretty well here, and is
> a very simple soultion. ;) -Paul[/color]
Don't you have to pass x'00' by value? And what about pointers being
larger than 8 bits? And what's with systems where NULL is *not* 0x00?
Sebastian
--
signature intentionally left blank
Re: RPG ILE with NULL fields
Jack wrote:[color=blue]
>
> My RPG ILE app (under V5R2M0) has to "talk" with a Java app. On the
> Java side, they're used to work with NULL fields. And they're expecting
> me to return them NULL fields via parameters.
>
> I do know fields in database can be NULL-capable fields. The thing,
> though, is how can I define a working field to be NULL-capable.
>
> I have to do that because instead of returning a blank field from the
> database, the Java guys would rather like me to return a Null string...
> and we don't want to change the same fields in the DB to be
> NULL-capable...
>[/color]
Can you give more details in how your RPG app is talking with the Java
app? I'm guessing that the Java guys are using a different meaning for
"NULL" than null-capable fields in a database.
If they do mean null-capable database fields, get them to describe how
they would use the returned parameter in Java. A bit of Java code would
be helpful (the Java definitions, the Java code that tests for the
parameter being null). Actually, that would be helpful even if they
don't mean null-capable database fields.