RPG ILE with NULL fields - IBM AS400

This is a discussion on RPG ILE with NULL fields - IBM AS400 ; 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 ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: RPG ILE with NULL fields

  1. RPG ILE with NULL fields

    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


  2. Re: RPG ILE with NULL fields


    Jack wrote:
    > 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


    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


  3. Re: RPG ILE with NULL fields

    Have you tried the BIF %nullind ? eval flda = %nullind("null value")



    Jack wrote:
    > 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



  4. Re: RPG ILE with NULL fields

    Have you tried the BIF %nullind ? eval flda = %nullind("null value")



    Jack wrote:
    > 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



  5. 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.co m>, on 12/01/06
    at 04:06 PM, david.anderson@encompassgroup.net said:



    >Have you tried the BIF %nullind ? eval flda = %nullind("null value")




    >Jack wrote:
    >> 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


    --
    -----------------------------------------------------------
    Paul@Raulresons.com
    -----------------------------------------------------------


  6. 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
    http://mowyourlawn.com


  7. Re: RPG ILE with NULL fields

    On Sat, Dec 02, 2006 at 05:33:35PM -0600, Paul-NO-SPAM@Raulersons.com wrote:
    > Also, a NULL is simple X'00' character. It works pretty well here, and is
    > a very simple soultion. -Paul


    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

  8. Re: RPG ILE with NULL fields

    Jack wrote:
    >
    > 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...
    >


    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.

+ Reply to Thread