Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Programming Guide

Host structure example

The following example shows the declaration of a host structure and an indicator array followed by two SQL statements that are equivalent, either of which could be used to retrieve the data into the host structure.

  dcl 1 games,
        5 sunday,
          10 opponents char(30),
          10 gtime     char(10),
          10 tv        char(6),
          10 comments  char(120) var;
  dcl indicator(4) fixed bin (15);


  exec sql
       fetch cursor_a
       into :games.sunday.opponents:indicator(1),
            :games.sunday.gtime:indicator(2),
            :games.sunday.tv:indicator(3),
            :games.sunday.comments:indicator(4);


  exec sql
       fetch cursor_a
       into :games.sunday:indicator;

Notice that in the first example all of the indicator variables in the array are specified sequentially beginning with the first member. Any out of sequence indicator variable would be flagged as an error.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)