ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SQL5011 30 Position 23 Host structure array OUTRESULTS3 not defined or not usable.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL5011 30 Position 23 Host structure array OUTRESULTS3 not defined or not usable.

    Hi,

    I am getting an error while compiling SQLRPGLE program. "SQL5011 30 Position 23 Host structure array OUTRESULTS3 not defined or not usable."

    Declared OUTRESULTS3 as global and one procedure is getting DS values and another procedure is inserting the Bulk insert to a temporary table.

    ------------------------------------------------------------------------------------------------------------
    My program DS declaration is as follows,
    D outResults3 DS likeds(outDetailDs)
    D dim(32000)

    insert procedure int the program is as follows,
    P loadFepDetailTable...
    P B
    D PI
    D
    /free
    exec sql
    insert into TEMPTABLE
    :rowCount rows // rowCount value is 32000
    values(utResults3)
    with NC;
    return;
    /end-free
    P loadFepDetailTable...
    P E
    ------------------------------------------------------------------------------------------------------------

    outDetailDs is define in a copybook as below,

    D outDetailDs...
    D DS qualified
    D rsDate_Id 4P 0
    D rsDate_Field D datfmt(*ISO)
    D rsFiscal_Year 5P 0
    D rsFiscal_Period...
    D 4P 0
    D rsFiscal_Week 4P 0
    D rsFiscal_Day 4P 0

    I am not able to compile the program. I tried to give DATEFMT (*ISO ) option while compiling, it doesn't work.

    Can anyone please tell what is the issue with my code?

  • #2
    That error usually means the setup of the DS does not match the requirements of the SQL statement it is being used in. E.g. wrong number of fields, wrong data types, etc.

    Unfortunately that statement is not in the code you provided so we can't check it for you.

    You need to post the SQL statement that is using OUTRESULTS3.

    Comment

    Working...
    X