Previous Topic: Wide ReportsNext Topic: Writing to a Disk File with SELECT


Creating a Report with SELECT

This example uses a SELECT statement to retrieve information about departments and employees. It also creates a report (rather than writing to disk). To display your output in a report, issue a DISPLAY command in your input data stream:

INPUT:
SET USER ABC PASS ABCPASS
SET ACCESS OLQ
OLQ 092032 00 PROCESSING MODE CHANGED TO OLQ.
SELECT * FROM DEPARTMENT, EMPLOYEE WHERE -
 DEPARTMENT.DEPT-HEAD-ID-0410 EQ EMPLOYEE.EMP-ID-0415
DISPLAY COLS DEPT-NAME-0410 DEPT-HEAD-ID-0410 EMP-LAST-NAME-0415


Output:
        OLQ RELEASE 16.0                  DATE: 96.267 TIME: 11:00 PAGE: 0001
            Copyright (C) 2003 CA, Inc.

OLQ 107017 00  CA OLQ Release 16.0
OLQ 107019 00  Copyright(C) 2003 CA, Inc.
  SET USER ABC PASS ????????
  SIGNON SS EMPSS01 DBN=EMPDEMO DICTNAME TESTDICT

OLQ 100021 00  Ready to retrieve data from subschema IDMSNWKA
OLQ 100022 00  Schema:    EMPSCHM           Version:       1
OLQ 100023 00  Database name:    EMPDEMO
OLQ 100025 00  Dictionary name:  TESTDICT
SELECT * FROM DEPARTMENT, EMPLOYEE WHERE -
OLQ 092022 00  Continuation line accepted
DEPARTMENT.DEPT-HEAD-ID-0410 EQ EMPLOYEE.EMP-ID-0415
OLQ 098006 00  9 whole lines and 0 partial lines in report.
OLQ 098007 00  18 records read.   18 records selected.
DISPLAY COLS DEPT-NAME-0410 DEPT-HEAD-ID-0410 EMP-LAST-NAME-0415
                                           DEPARTMENT/EMPLOYEE REPORT
                                                     9/19/91
               DEPT-NAME-0410       DEPT-HEAD-ID-0410 EMP-LAST-NAME-0415
EXECUTIVE ADMINISTRATION                           30 HENDON
ACCOUNTING AND PAYROLL                             11 JENSON
PERSONNEL                                          13 PEOPLES
INTERNAL SOFTWARE                                   3 GARFIELD
BLUE SKIES                                        321 MOON
COMPUTER OPERATIONS                                 4 CRANE
PUBLIC RELATIONS                                    7 BANK
BRAINSTORMING                                      15 MAKER
THERMOREGULATION                                  349 WILCO
    END OF REPORT

        OLQ RELEASE 16.0                  DATE: 96.267 TIME: 11:00 PAGE: 0003
            Copyright (C) 2003 CA, Inc.

BYE
OLQ 100029 00  Signoff accepted - OLQ session terminated.