2007 May 16 12:21 PM
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
2007 May 16 12:24 PM
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
2007 May 16 12:24 PM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |