Topic
  • 5 replies
  • Latest Post - ‏2013-07-05T12:52:11Z by MoonTech
MoonTech
MoonTech
16 Posts

Pinned topic Cobol-egl null pointer crashes on rbd 8.5 with empty queries

‏2013-06-18T22:35:41Z |

Hello

We have null pointer errors with sql cursors in egl based egl programs

 

we have an egl sentence like : "get next"

The select doesnt bring results. The sqlcode is 100 

the generated cobol calls vgnrsvcs. This program brings back one error code of 4

 

after that, the program crash in eze-throw-sql-exception

Null pointer

 

any trick?

 

Updated on 2013-07-05T12:51:50Z at 2013-07-05T12:51:50Z by MoonTech
  • MoonTech
    MoonTech
    16 Posts
    ACCEPTED ANSWER

    Re: Cobol-egl null pointer crashes on rbd 8.5 with empty queries

    ‏2013-07-05T12:52:11Z  

    PRoblem solved with RBD 8.5.1

  • Demir
    Demir
    3 Posts

    Re: Cobol-egl null pointer crashes on rbd 8.5 with empty queries

    ‏2013-06-19T11:39:25Z  

    Hi,

    Exactly, I don't know if it would help you but in records definition of EGL RichUI we are using '?' - question mark - for the fields that have possible null value.

    For example; in below for the integer type was used as bigInt?

    resultSymbolClassId bigInt?             {column="RESULT_SYMBOL_CLASS_ID"};

    Good luck.

  • Kendall.Coolidge
    Kendall.Coolidge
    84 Posts

    Re: Cobol-egl null pointer crashes on rbd 8.5 with empty queries

    ‏2013-06-19T14:59:04Z  

    We had what sounds like a similar problem with 8.5.1 when a call to Systemi stored procedure returned an empty result set.  If this is the same issue, IBM has a fix if you ask for the PMR mentioned in this link:

     

    https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014925558

  • MoonTech
    MoonTech
    16 Posts

    Re: Cobol-egl null pointer crashes on rbd 8.5 with empty queries

    ‏2013-06-19T15:09:19Z  
    • Demir
    • ‏2013-06-19T11:39:25Z

    Hi,

    Exactly, I don't know if it would help you but in records definition of EGL RichUI we are using '?' - question mark - for the fields that have possible null value.

    For example; in below for the integer type was used as bigInt?

    resultSymbolClassId bigInt?             {column="RESULT_SYMBOL_CLASS_ID"};

    Good luck.

    thank you. We are not using RUI since we are working with "green screen" EGL/cobol programs

  • Demir
    Demir
    3 Posts

    Re: Cobol-egl null pointer crashes on rbd 8.5 with empty queries

    ‏2013-06-20T05:40:42Z  
    • MoonTech
    • ‏2013-06-19T15:09:19Z

    thank you. We are not using RUI since we are working with "green screen" EGL/cobol programs

    Hi,

    We are also using SQLRPGLE queries for the green screens.

    Then to avoid null values; " IFNULL(charField, '-'),  IFNULL(numericField, '0') or COALESCE(charField, '-') " functions are the best solution.  

    For the example, as a part of sqlQuery; 

    c/exec sql                                              
    c+ declare c1 cursor for                                
    c+ SELECT DISTINCT OANRFT, OANRKL,                      
    c+ CASE WHEN MNNRKM BETWEEN 1 AND 9999998               
    c+ THEN MNNRKM ELSE MNNRKL END MNNRKM,                  
    c+ CPNMKL, ADSTAD, ADWP,                                
    c+ OADTPF, OANROA, OANROP, MNNROL,                      
    c+ IFNULL(MNOMMO, '*') MNOMMO, MPCDPF,                  
    c+ IFNULL(VAOMVA, '*') VAOMVA, IFNULL(MPBDPD, 0) MPBDPD,
    c+ IFNULL(OACDVB, '*') OACDVB, ......
    .....
    .....        

    Regards.

                 
  • MoonTech
    MoonTech
    16 Posts

    Re: Cobol-egl null pointer crashes on rbd 8.5 with empty queries

    ‏2013-07-05T12:52:11Z  

    PRoblem solved with RBD 8.5.1