Previous Topic: =MACRO AMLIST OverviewNext Topic: CA Culprit in the CA IDMS/DB Environment


=MACRO AMLIST

Purpose

Lists the contents of data files.

Syntax

    Col
    1
    ▼                                                      ┌──────────────┐
►►─ =MACRO AMLIST field-count ( ┬ record-count ┬ 'header' ─▼─ field-name ─┴ )─►
                                └ ALL ─────────┘

 ►─ =MEND ────────────────────────────────────────────────────────────────────►◄

Syntax Rules

=MACRO AMLIST

Identifies the list routine instruction. It must be coded starting in column 1.

field-count

Specifies the number of fields to be listed in the report. Field-count must be a number in the range 3 through 10.

record-count

Specifies the number of records to be printed; record-count must be a positive integer value.

ALL

Specifies that all records of the file are to be printed in the report.

'header'

A 1- to 53-character alphanumeric literal that specifies a header for the report. 'Header' must be enclosed in single quotation marks.

field-name

Specifies the names of fields to be listed in the report. The field names must be defined on REC parameters. These names also serve as report column headers. The number of field names specified must be the same as the number coded for field-count.

=MEND

Signals the end of an =MACRO parameter. Each =MACRO parameter must have a corresponding =MEND parameter.

=MEND must be coded starting in column 1; no other information may appear on the same line.

Usage

The report generated by the =MACRO AMLIST parameter can be modified by coding CA Culprit parameters immediately following the =MEND instruction, as described below:

Usage

=MACRO AMLIST parameters can continue from one line to the next; an asterisk (*) is required in column 1 of each continuation line.

=CHANGE and =DROP clauses can follow an =MACRO AMLIST instruction; an =MEND instruction must follow.

Examples

Sample =MACRO AMLIST parameters are shown and described below.

Example 1

 REC EMP-NAME  1  25
 REC TITLE    50  20
 REC SALARY   70  10   3 DP=2
=MACRO AMLIST3 (10 'COMPANY EMPLOYEES' EMP-NAME TITLE
*               SALARY)
=MEND

The =MACRO AMLIST parameter outputs three input file fields: EMP-NAME, TITLE, and SALARY. The first ten records in the input file will print; the field names act as column headers. The report will contain detail information only; the header for the report is COMPANY EMPLOYEES.

The following two figures illustrate the Sequential Parameter Listing generated by the =MACRO AMLIST instruction and the report generated. The Sequential Parameter Listing displays a plus sign (+) to identify parameters copied by the AMLIST instruction. CA Culprit substitutes the argument values for the symbolic parameters; two plus signs (++) identify parameters for which a substitution has occurred.

Example 2

=MACRO AMLIST3 (10 'COMPANY EMPLOYEES' EMP-NAME TITLE
*               SALARY)
=CHANGE R=01
=MEND
 01SORT TITLE,-
 017010 SALARY GT 25000 DROP
 0161*030 SALARY

The =MACRO AMLIST parameter is the same as the one described in the above example except that the report generated by this statement is modified by the =CHANGE clause, the SORT parameter, the type 7 process parameter, and the type 6 edit parameter that follow the =MEND clause. In this example, the records print in alphabetical order by job title. Records with a value for SALARY greater than 25000 are not extracted. The total line prints the accumulated value for SALARY for each control break and at the end of the output phase.

Sequential Parameter Listing Using =MACRO AMLIST

mm/dd/yy SEQUENTIAL PARAMETER LISTING Vnn.n PAGE 00 ** SYSIN ** IN 80 INSTALLATION SECURITY OPTION IS NO REC EMP-NAME 1 25 REC TITLE 50 20 REC SALARY 70 10 3 DP=2 =MACRO AMLIST3 (10 'COMPANY EMPLOYEES' EMP-NAME TITLE * SALARY) =MEND ┌── + 03$00****Culprit ROUTINE-AMLIST3 │ + 030 SEQUENCE ALL │ + 033DETAIL LIST │ + 034100010&&2 │ ++ 034100010'COMPANY EMPLOYEES' │ + 03420001 ' ' Parameters │ + 0351*010 &&3 HF copied from │ ++ 0351*010 EMP-NAME HF library member ──────┤ + 0351*020 &&4 HF AMLIST3 │ ++ 0351*020 TITLE HF │ + 0351*030 &&5 HF │ ++ 0351*030 SALARY HF │ + 0368*001 ' ' │ + 037110SEQUENCE A 1 SEQUENCE $ COUNT RECORDS READ │ + 037 M &&1 ALL $ GET MAXIMUM │ ++ 037 M 10 ALL $ GET MAXIMUM │ + 037 ALL EQ 0 TAKE $ TAKE ALL RECORDS │ + 037 SEQUENCE GT &&1 DROP $ DROP IF OVER MAXIMUM └── ++ 037 SEQUENCE GT 10 DROP $ DROP IF OVER MAXIMUM

Report Generated Using =MACRO AMLIST

REPORT NO. 03 DETAIL LIST mm/dd/yy PAGE 1 COMPANY EMPLOYEES ▲ ┌─ │ Field names───────────────┤ EMP─NAME TITLE SALARY │ used as └─ │ column TERRY CLOTH HUMIDITY CONTROL CLK 38,000.00 │ headers PHINEAS FINN KEEPER OF BALLOONS 45,000.00 │ JOE KASPAR WINTERIZER 31,000.00 │ MARK TIME WINTERIZER 33,000.00 │ ROGER WILCO MGR THERMOREGULATION 80,000.00 │ ROY ANDALE SNOWBLOWER 33,500.00 │ HARRY ARM STURM/DRANG ADMIN 46,000.00 │ C. BREEZE KEEPER OF THE WINDS 38,000.00 │ CAROLYN CROW RAINDANCE CONSULTANT 37,500.00 │ BURT LANCHESTER RAINMAKER 54,500.00 │ │ RECORDS WRITTEN FOR REPORT 03— 16 │ │ │ └────── Report header