Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

get datset

Former Member
0 Likes
383

Can any one tell me about <b>get dataset</b> and syntax of it.please explain

Message was edited by:

sameer k

Message was edited by:

sameer k

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
357

Hello,

The system creates three field groups and fills them with several fields. It then fills the extract in the EXTRACT statements in the GET events. Note that there is no EXTRACT statement for GET SFLIGHT, since the required field SFLIGHT_FLDATE is part of the HEADER field group and thus automatically extracted for each subordinate event GET SBOOK.

After retrieving the data, the system terminates the creation of the dataset when the SORT statement occurs, and sorts the dataset by the HEADER sort key. In the LOOP-ENDLOOP block, it writes the sorted extract dataset to the output list, using various AT ... ENDAT blocks and the fields CNT(...) and SUM(...).


REPORT DEMO.

NODES: SPFLI, SFLIGHT, SBOOK.

FIELD-GROUPS: HEADER, FLIGHT_INFO, FLIGHT_BOOKING.

INSERT:
  SPFLI-CITYFROM SPFLI-CITYTO
  SPFLI-CONNID SFLIGHT-FLDATE
  SBOOK-CLASS SBOOK-SMOKER SBOOK-BOOKID INTO HEADER,
  SPFLI-CARRID                          INTO FLIGHT_INFO,
  SBOOK-LUGGWEIGHT SBOOK-WUNIT          INTO FLIGHT_BOOKING.

START-OF-SELECTION.

GET SPFLI.
  EXTRACT FLIGHT_INFO.

GET SFLIGHT.

GET SBOOK.
  EXTRACT FLIGHT_BOOKING.

END-OF-SELECTION.

  SORT.

  LOOP.
    AT FLIGHT_INFO.
      SKIP.
      WRITE: / SPFLI-CARRID,
               SPFLI-CONNID,
               'from', (15) SPFLI-CITYFROM,
               'to',   (15) SPFLI-CITYTO.
      ULINE.
    ENDAT.
    AT NEW SFLIGHT-FLDATE.
        SKIP.
        WRITE: / 'Date:', SFLIGHT-FLDATE.
        WRITE: 20 'Book-ID', 40 'Smoker', 50 'Class'.
        ULINE.
    ENDAT.
    AT FLIGHT_BOOKING.
        WRITE: / SBOOK-BOOKID UNDER 'Book-ID',
                 SBOOK-SMOKER UNDER 'Smoker',
                 SBOOK-CLASS  UNDER 'Class'.
    ENDAT.
    AT END OF SFLIGHT-FLDATE.
      ULINE.
      WRITE: 'Number of bookings:  ', (3) CNT(SBOOK-BOOKID),
           / 'Total luggage weight:',
              SUM(SBOOK-LUGGWEIGHT), SBOOK-WUNIT.
    ENDAT.
  ENDLOOP.


Regards,

Deepu.K

Can any one tell me about <b>get dataset</b> and syntax of it.please explain

Message was edited by:

sameer k

Message was edited by:

sameer k

1 REPLY 1
Read only

Former Member
0 Likes
358

Hello,

The system creates three field groups and fills them with several fields. It then fills the extract in the EXTRACT statements in the GET events. Note that there is no EXTRACT statement for GET SFLIGHT, since the required field SFLIGHT_FLDATE is part of the HEADER field group and thus automatically extracted for each subordinate event GET SBOOK.

After retrieving the data, the system terminates the creation of the dataset when the SORT statement occurs, and sorts the dataset by the HEADER sort key. In the LOOP-ENDLOOP block, it writes the sorted extract dataset to the output list, using various AT ... ENDAT blocks and the fields CNT(...) and SUM(...).


REPORT DEMO.

NODES: SPFLI, SFLIGHT, SBOOK.

FIELD-GROUPS: HEADER, FLIGHT_INFO, FLIGHT_BOOKING.

INSERT:
  SPFLI-CITYFROM SPFLI-CITYTO
  SPFLI-CONNID SFLIGHT-FLDATE
  SBOOK-CLASS SBOOK-SMOKER SBOOK-BOOKID INTO HEADER,
  SPFLI-CARRID                          INTO FLIGHT_INFO,
  SBOOK-LUGGWEIGHT SBOOK-WUNIT          INTO FLIGHT_BOOKING.

START-OF-SELECTION.

GET SPFLI.
  EXTRACT FLIGHT_INFO.

GET SFLIGHT.

GET SBOOK.
  EXTRACT FLIGHT_BOOKING.

END-OF-SELECTION.

  SORT.

  LOOP.
    AT FLIGHT_INFO.
      SKIP.
      WRITE: / SPFLI-CARRID,
               SPFLI-CONNID,
               'from', (15) SPFLI-CITYFROM,
               'to',   (15) SPFLI-CITYTO.
      ULINE.
    ENDAT.
    AT NEW SFLIGHT-FLDATE.
        SKIP.
        WRITE: / 'Date:', SFLIGHT-FLDATE.
        WRITE: 20 'Book-ID', 40 'Smoker', 50 'Class'.
        ULINE.
    ENDAT.
    AT FLIGHT_BOOKING.
        WRITE: / SBOOK-BOOKID UNDER 'Book-ID',
                 SBOOK-SMOKER UNDER 'Smoker',
                 SBOOK-CLASS  UNDER 'Class'.
    ENDAT.
    AT END OF SFLIGHT-FLDATE.
      ULINE.
      WRITE: 'Number of bookings:  ', (3) CNT(SBOOK-BOOKID),
           / 'Total luggage weight:',
              SUM(SBOOK-LUGGWEIGHT), SBOOK-WUNIT.
    ENDAT.
  ENDLOOP.


Regards,

Deepu.K