You are on page 1of 66

Introduction To CL/400

Programming

CL 400 ver 1.0

Introduction To CL
Programming

OS/400
Object on AS/400
Library List

CL 400 ver 1.0

Introduction To CL
Programming
Library list associated with a job consists of
four parts
1) System libraries
2) Product libraries
3) Current library
4) user libraries
Some system libraries are Qsys , Qusersys ,
Qhlpsys

For one job max of 25 libraries can be defined .

CL 400 ver 1.0

Introduction To CL
Programming

Control Language is the primary interface to


the operating system
Single Control Language Statement is called
as command
Each command is made up of Command name
and parameters
Some functions require CL that cannot be
entered individually and must be a part of CL
program.

CL 400 ver 1.0

Introduction To CL
Programming

CL Commands
Basic CL command
To see the Jobs library lis

DSPLIBL
DSPJOB
EDTLIBL

CRT
PF , PL , DSPF
DLT
F, PGM , CLPGM , CBLPGM
CHGXXX , DSPXXX , WRKXXX

CL 400 ver 1.0

Introduction To CL
Programming

CL Commands Syntax 1

Keyword Form
DSPLIB LIB(PAYLIB) OUTPUT(*PRINT)

Positional Form
DSPLIB PAYLIB *PRINT
COMBINATION FORM
DSPLIB PAYLIB OUTPUT(*PRINT)

CL 400 ver 1.0

Introduction To CL
Programming

CL Commands Syntax 2

SNDUSRMSG MSG(Todays date is *CAT


&Date) + MSGTYPE(*INFO) /* Todays date*/

& Date --> variable


+ ----> Continuation
*INFO ----> Pre-Defined values
/* */ ---->comments

CL 400 ver 1.0

Introduction To CL
Programming

CL programs can be used in batch or


interactive processing
CL programs are meant for system handling,
system resources and strictly not for data
handling

CL 400 ver 1.0

Introduction To CL
Programming

Optional PGM command beginning the program


and identifying any parameters received
Mandatory declarations of pgm variables are
used
the declare command must preceed all
commands except pgm.
CL processing commands are used which can
also include logic control , built-in
functions,program control commands.
Optional Endpgm command

CL 400 ver 1.0

Introduction To CL
Programming

Program Structure
PGM (&Parm1, & Parm2 ) ..Optional
DCLF (Max. of One)
DCL Variable
MONMSG (Program level monitor messages)
Logic with CL Commands

IF , ELSE
CL COMMAND
MONMSG (Command Level )

ENDPGM

CL 400 ver 1.0

Introduction To CL
Programming

DCL (Declare CL variable )


DCL VAR(&NAME) TYPE ( ) LEN( ) VALUE ( )

Type

*DEC
*CHAR
*LGL

Len(Default)

Max.

Values

(15 5)
(32)
1

(15 9)
(9999)

Default (0)
Default(B)
Default(0)

Arithmetic Operation

*EQ , *GT

CL 400 ver 1.0

Introduction To CL
Programming

Relational and logical Expressions)

*LT
*EQ
*GT
*LE
*NL
*NG
*GE
*NE
*AND
*OR
*NOT

CL 400 ver 1.0

Less Than
Equal To
Greater Than

Introduction To CL
Programming

IF and ELSE Statement


IF COND(&BALANCE *LT 1000) THEN (CALL PGM (OVERFLOW)

Do Statement
IF COND(&BALANCE *LT 1000)
THEN (DO)
CALL PGM1
CALL PGM1
ENDDO

GOTO command
Branching within program

CL 400 ver 1.0

Introduction To CL
Programming

Branching Outside a Program --Call , TFRCTL


PGMA
PGM
.
.
Call
PGMB
.

PGMB
PGM
.
.
.
Call PGMC
...
.
.
.
TFRCTLPGMD
.

PGMD
.
.
.
RETURN

CL 400 ver 1.0

PGMC
PGM
.
.
.
ENDPGM

Introduction To CL
Programming

Branching Outside a Program --Call , TFRCTL

TRFCTL cannot pass a variable that was not passed passed


to the program running the TRFCTL command.
Return command in a CL program removes the program
from call stack and control is returned to the next
sequential statement after that call command in the
calling program.
When a call command is issued by a CL Program , a
maximum of 40 parameters can be passed to the called
program.
The values of parameters are passed in the order in which
they appear and this must match the order of called pgm.

CL 400 ver 1.0

Introduction To CL
Programming

A File in CL is opened for input and output


CL programs cannot be used to Add or Update
records in DB files ,
CL programs can use printer files , use
Subfiles (display) files.
CL Commands For File

SNDRCVF RCDFMT(FILFMT)
SNDF RCDFMT(FILFMT)-- Control given to file for reading
RCVF RCDFMT(FILFMT)--- control given to program

CL 400 ver 1.0

Introduction To CL
Programming

Write Program for calculator

CL 400 ver 1.0

Introduction To CL
Programming

Concatenation (two *char variable or values)


three types of Concatenation
1) *Cat 2)*Tcat 3) *Bcat
*Cat : Concatenate without editing
*Tcat : All trailing blanks in first character
string are truncated
*Bcat : Trailing blanks in first character string
are truncated . One blank is inserted then the
two strings are concatenated.

CL 400 ver 1.0

Introduction To CL
Programming

HLL and CL programs may Call Each Others


RPG/400

FACTOR1 OPCODE FACTOR2 NAME LNG DEC


*ENTRY
PLIST
PARM
CUST
5
0
PARM
*IN98
X
1

Linkage Section(COBOL)

01
01

Customer
IN98
PIC

PIC
1.

Procedure Division

CL 400 ver 1.0

Using Customer, IN98.

S99999 .

Introduction To CL
Programming

Conversion of Data Types

CHGVAR VAR(CL-Variable) Value( Operand + / - *


operand)
CHGVAR VAR(&Counter) Value( &Counter + 1)
CHGVAR &AMT ((&Price - &Counter) * &Qty
Character Variable
&A

Character Variable
&B

Length

Length

7
7
7

CL 400 ver 1.0

Converted Result
0023.00
-003.90
-123.67

5.2
5.2
5.2

Converted Result
23.00
-03.90
-123.67

Introduction To CL
Programming

Program Menu

GO MENUA

Menu : MENUA
RUN *PGM: PGMA
Return code specify next step

CL 400 ver 1.0

Menu Name
Lib. Name
Return code

*PGM: PGMA
Set Return Code
End Of Program

Introduction To CL
Programming

Coding for the program to interface with


MENU
PGM PARM(&MENUNAME &MENULIB &CODE)
DCL &MENUNAME
*CHAR 10
DCL &MENULIB
*CHAR 10
DCL &CODE
*CHAR 2
DCL &HOME
*CHAR 2 VALUE (XFFCC)
DCL &EXIT
*CHAR 2 VALUE (XFFFF)
DCL &CANCEL
*CHAR 2 VALUE (XFFFE)
DCL &AGAIN
*CHAR 2 VALUE (X0000)
CHGAVAR &CODE VALUE(*AGAIN)
ENDPGM

CL 400 ver 1.0

Introduction To CL
Programming

Create Menu
CRTMNU
MENU(NAME)
PGM(*MENU)
CURLIB(*NOCHG)
PRDLIB(*NOCHG)
REPLACE(*YES)
TEXT(*BLANK)

CL 400 ver 1.0

TYPE(*PGM)

Introduction To CL
Programming

Program Testing

Debug Environment

Trace
Processing Sequence
Value of Variable
Breakpoints
Stop at breakpoints
Display or change variables
Command Entry

CRTCLPGM

CL 400 ver 1.0

Introduction To CL
Programming

CL 400 ver 1.0

Introduction To CL
Programming

Program Testing

STMT : Statement number


PGMVAR : Program variable
START : For character variable
LEN :: For character variable

Example :

STRDBG PGM(PGMA) DFTPGM(*PGM)


ADDBKP STMT(LABEL1 LABEL2 1200) PGMVAR(&VAR1 &VAR2)
CALL PGMA

CL 400 ver 1.0

Introduction To CL
Programming

Program Testing

STMT : Statement number


PGMVAR : Program variable
START : For character variable
LEN :: For character variable

Example :

STRDBG PGM(PGMA) DFTPGM(*PGM)


ADDBKP STMT(LABEL1 LABEL2 1200) PGMVAR(&VAR1 &VAR2)
CALL PGMA
DSPBKP(Display Break points)
AT Break points
DSPPGMVAR
CHGPGMVAR
ADDBKP
CL 400 ver 1.0

Introduction To CL
Programming

Program Testing

Tracing Example :
STRDBG PGM(PGMA) DFTPGM(*PGM)
ADDTRC PGMVAR(&VAR1 &VAR2) STMT(LABEL1 LABEL2 1200)
CALL PGMA
DSPTRCDTA OUTPUT(*, *PRINT) (Display Trace points)
CLRTRCDTA
ENDDBG
In Breakponits user is given control but tracing it is not like that

CL 400 ver 1.0

Introduction To CL
Programming

Retrieve CL Program Source(RTVCLSRC)

Program should be created with ALWRTVSRC(*YES)

RTVCLSRC PGM (ABCXXX) SRCFILE(QCLSRC)


SRCMBR(*PGM)

CL 400 ver 1.0

Introduction To CL
Programming

Extracting Part of a *Char Value

%Substring

C L P

0 0 7

is used to extract part of a *char value.


Also represented as %sst.
The format is %sst(*Lda/variable name x y) where x is the starting
position and y is no. of positions from x.
For starting and length positions variables can also be used
CHGVAR VAR(&TEAM) VALUE(%SST(&USER 4 3)
&TEAM ????

%switch

CL 400 ver 1.0

is another built in function


Used for program to program communications within a job. Initially
set by *jobd and dft is 00000000(ABCXXX) SRCFILE(QCLSRC)
SRCMBR(*PGM)

Introduction To CL
Programming

Data area

Data Area is an object used to hold data for access by any


job running on the system.A data area can be used
whenever information of limited size is to be stored
Data areas are objects and must be created before they
can be used in program
It can contain character string of upto 2000 characters a
decimal value with different attributes.For CL programs
max of 15 digits or 9 decimal places but only 15 digits in
total. For other languages it can have total length of 24
(15,9).

CL 400 ver 1.0

Introduction To CL
Programming

CHGDTAARA

RTVDTAARA

Command retrieve all or part of a specified data area and


copies it to a variable in CL program.
RTVDTAARA DTAARA(*LDA (6 10))
RTNVAR(&YOURLIB)

DSPDTAARA

Command changes all or part of the value of a specified data


area
CHGDTAARA DTAARA(*LDA (6 10))
VALUE(MYLIB)

Command is used to display a particular data area.

ALCOBJ

Command is used to prevent other users from accessing the


data area until your operations are completed.

CL 400 ver 1.0

Introduction To CL
Programming

Retrieving External Attributes


JOB Attributes

SYSTEM Attributes

RTVSYSVAL
CHGSYSVAL

USR PROFILE

RTVJOBA
CHGJOB

RTVUSRPRF
CHGUSRPRF
CHGPRF

CVTDAT DATE () TOVAR (CL Variable)

CL 400 ver 1.0

Introduction To CL
Programming

If a command is coded with no parameters but


is preceded by a question mark , the user will
be prompted for the commands parameter
during execution of the program.
?- preceding a parameter will omit that
parameter from the display
?* shows parameter but cannot be changed
?? Shows parameter and can be changed but
displayed value will be the default value.

CL 400 ver 1.0

Introduction To CL
Programming

Each predefined message in a message file is


uniquely identified by a 7-character code and
is defined by description
All messages that are send or received in the
system are transmitted through a message
queue.
Commands for messaging are
1) SNDUSRMSG
2) SNDPGMMSG
3) SNDMSG &SNDBRKMSG

CL 400 ver 1.0

Introduction To CL
Programming

SNDUSRMSG &SNDPGMMSG can work with


immediate and predefined messages
SNDMSG & SNDBRKMSG can be used only with
immediate messages.
Predefined messages reside in message file
and it can be created by command
CRTMSGF.an object is created of type *MSGF
Message file QCPFMSG in library QSYS
contains the system messages
when we have to send a message in
predefined way we will give msg file name and
msg id.

CL 400 ver 1.0

Introduction To CL
Programming

When a message is sent, it is defined as one of the

following types:
Informational (*INFO). A message that conveys
information about the condition of a function.

Inquiry (*INQ). A message that conveys information


but also asks for a reply.

Notify (*NOTIFY). A message that describes a


condition for which a procedure or program requires
corrective action or a reply from its calling procedure
or program. A procedure or program can monitor for
the arrival of notify messages from the programs or
procedures it calls.

CL 400 ver 1.0

Introduction To CL
Programming
R FMT001CA06(06 Display Maesge)
.
R MENUSFL
TEXT(MESSGAE SFL DATA)
SFL
SFLMSGRCD(24)
MSGKEY SFLMSGKEY
MENUPGMQ
SFLPGMOQ
R MENUSFLC
TEXT(Menu SFL Control)
LOCK
SFLCTL(MENUSFL)
SFLPAG(1)
51 SFLDSP
51 SFLDSPCTL
51 SFLEND
51 SFLINZ
SFLPGMOQ
CL 400 ver 1.0

Introduction To CL
Programming

Message queues are of two types


1) External message queue.
2) Program message queue.
External message queue is used when a batch
job has to communicate and QSYSOPR ie system
supplied system operator message queue is
used
Program message queue is subdivided in three
parts
1) workstation message queue
2) User message queue
3) user defined.

CL 400 ver 1.0

Introduction To CL
Programming

Exception handling in CL programs is done


through MONMSG.
MONMSG can be used at program level or at
command level
MRGMSGF command is used to merge some
messages from QCPFMSG to user message
file.

CL 400 ver 1.0

Introduction To CL
Programming

PGM
ALCOBJ OBJ ((LIB/FILE *FILE *EXCL)) WAIT(0)

MONMSG MSGID(CPF1002) EXEC(DO)


SNDUSRMSG MSG( Program can not run now because file I
not + available ) MSGTYPE (*INFO) TOMSGQ(*EXT)
RETURN
ENDDO

CALL PGM(PGM1)
DLCOBJ OBJ( LIB/FILE *FILE *EXCL))

ENDPGM

CL 400 ver 1.0

Introduction To CL
Programming
PGM
/*Program level MONMSG */
MONMSG MSGID(CPF9801) EXEC(GOTO ERROR)
MONMSG MSGID(CPF7302)
/*CHECK FOR MASTRE FILE */
CHKOBJ PAYMAST *FILE
CHKOBJ GLMAST *FILE
/*NEW WORK FILE*/
AGAIN: CRTPF QTEMP/WORK
MONMSG MSGID(CPF7302) EXEC(DO)

CL 400 ver 1.0

Introduction To CL
Programming
MONMSG MSGID(CPF7302) EXEC(DO)
DLTF QTEMP/WORK
GOTO AGAIN
/*NEW TRANS FILE IF NONE EXISTS */
CRTPF LIB/PAYTRN
CALL PAYMONTHLY
RETURN
ERROR: SNDUSRMSG MSG(Master file missing (a) check *libl for
+ paylib (b) see supervisor.) MSGTYPE(*INFOR)
TOMSGQ(*EXT)
ENDPGM

CL 400 ver 1.0

Introduction To CL
Programming

Batch job can be initiated in three ways


1) Job from a job schedule object
2) Subsystem Autostart job
3) Submit job command SBMJOB
SBMJOB starts as asynchronous job
Different ways to pass data between interactive
and batch jobs are
1) Parameter passing
2) Data area/*Lda
3) Data queue
4) files

CL 400 ver 1.0

Introduction To CL
Programming

Creation of a command involves basically two


steps
1) CRTCMD
2) CPP (command processing program)
Command processing program receives
parameters from the DDS of the command and
this CPP can be written in any language.
Conditional prompting depends on a particular
condition and is specified by PMTCTL
parameter

CL 400 ver 1.0

Introduction To CL
Programming

CMD
PROMPT('Create New project')
PARM
KWD(PROJECT) TYPE(*NAME)
LEN(10) +
MIN(1)
PROMPT('Project name')
PARM
KWD(SHRTNAM) TYPE(*CHAR) LEN(4)
+
MIN(1) PROMPT('Short project
name')
PARM
KWD(TEXT) TYPE(*CHAR)
LEN(25) +
PROMPT(TEXT)

CL 400 ver 1.0

Introduction To CL
Programming

Create New project (CRTPRJ)


Type choices, press Enter.

Project name . . . . . . . . . . PROJECT


_______
Short project name . . . . . . . SHRTNAM
_______
TEXT . . . . . . . . . . . . . . TEXT
CL 400 ver 1.0

______

Introduction To CL
Programming

Parameters for creating a command are


1) CMD : Command specifies prompt text for
command
2) Parm : Defines a parameter
3) Elem : Elements of mixed list
4) Qual : Qualifier describes one part of the
qualifier name.
5) Dep : Dependent relationship between
parameter and their values
6) Pmtctl : Conditional parameter prompting

CL 400 ver 1.0

Introduction To CL
Programming

Data Queue
Open Query File

CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
Data Queues are a type of system object that you create, to
which one HLL program can send data and from which another
HLL program can receive data. The receiving program can be
already waiting for the data or can receive the data later.
Example showing how Data Queues work
Job1
Job2
Job3

CL 400 ver 1.0

DATAQ

Server Job

Introduction To CL
Programming
Data Queues
In the above example, several jobs place entries on a Data Queue.
The entries are handled by a server job.Any number of jobs can be
send to the same queue.
Data queues allow the primary job to route the work to the server
job. This frees the primary job to receive the next work request. Any
number of server jobs can receive from the same data queue.
When no entries are on a data queue, server programs have the
following options
Wait until an entry is placed on the queue
Wait for a specific period of time, if the entry still has not arrived
then continue processing
Do not wait.
CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
Prerequisite for using Data Queues
Data Queues are created using Create Data Queue (CRTDTAQ)
command. For example:
CRTDTAQ DTAQ(MYLIB / INPUT) MAXLEN(128) TEXT(Sample Data
Queue)
The MAXLEN parameter is required and specifies the maximum
length of the entries that can be sent to the data queue

CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
Managing the Storage Used by a Data Queue
When an entry is received from a data queue, the entry is
removed from the data queue but the auxiliary storage is not
freed. The same auxiliary storage is used again when a new entry
is sent to the data queue. The queue grows larger as entries are
sent to the queue and not received.
Performance is better if the size of the queue is kept less than
100 entries. If the data queue grows too large delete the queue
using the Delete Data Queue (DLTDTAQ) command then recreate
the queue using the CRTDTAQ command

CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
Receiving Data with Data Queues
To receive data from a data queue call the QRCVDTAQ program from
the HLL program . For example, in a CL program it is used as follows
CALL PGM (QRCVDTAQ) PARM(&QNAME &LIB &FLDLEN &WAIT +
&ORDER &KEYLEN &KEY &SNDRLEN &SNDR)
The five mandatory parameters are
&QNQME is a 10-byte character field that names the data queue.
&LIB is a 10-byte character field that names the library containing
the
data queue. *LIBL or *CURLIB can be used
&FLDLEN is a 5-digit packed decimal variable with no decimal
positions
&FIELD is a character field of length &FLDLEN. &FIELD is the field
that
receives the data coming from the data queue
CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
&WAIT is a 5-digit packed decimal field with no decimal
positions. When
no entries are in the data queue, the WAIT
parameter specifies the following:
A negative value indicates an unlimited wait request
Zero indicates to continue processing immediately(no
waiting). If no entry exists the call completes immediately
with &FLDLEN set to zero
A positive value specifies the number of seconds to wait
The maximum value, 99999 allows a wait of approximately 28
hours

The other five parameters are optional, however if you specify


one parameter you must specify all parameters.
CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
Sending Data with Data Queues
Call QSNDDTAQ PARM(&QNAME &LIB &FLDLEN &FIELD)
Clearing Data from Data Queues
To clear data from a data queue, call the QCLRDTAQ program from
your HLL program. For example in a CL program it is used as follows
CALL PGM(QCLRDTAQ) PARM (&QNAME &LIB)
The two that must be passed are
&QNAME is a 10-byte character field that names the data queue
& LIB is a 10-byte character field that names the library
containing the
data queue
CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
Advantages of Data Queues

Using Data Queues frees a job from performing some work. If the job
is an interactive job , data queues can provide response time and
decrease the size of the interactive program and its process access
group. This in turn can help overall system performance. For example
If several workstation users enter a transaction that involves updating
and adding to several files, the system can perform better if the
interactive jobs submit the request for the transaction to a single batch
processing job
Data

Queues are the fastest means of asynchronous communication


between two jobs. Using a data queue to send and receive data
requires less overhead than using database files, message queues or
data areas to send and receive data.
CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
Advantages of Data Queues
You can send to and receive from data queue in any HLL program
by calling the QSNDDTAQ, QRCVDTAQ programs without exiting the
HLL program or calling a CL program to send or receive the data
More

than one job can receive data from the same data
queue.This is advantageous in certain applications where the
number of entries to be processed is greater than one job can
handle within the desired performance restraints.For example
If several printers are are available to print orders several
interactive jobs could send request to a simple data queue. A
separate job for each printer could receive from the data queue
either in FIFO or LIFO order
CL 400 ver 1.0

Introduction To CL
Programming
Data Queues
Advantages of Data Queues
Data Queues have the ability to attach a sender ID to each
message
being placed on the queue.

CL 400 ver 1.0

Introduction To CL
Programming
OPEN QUERY FILE (OPNQRYF)
The Open Query File (OPNQRYF) command opens a file that contains
a set of database records that satisfies a database query request.
Once opened, the file looks like a database file opened by using the
Open Database File (OPNDBF) command, and the records in the file
are accessed by high-level language programs that share the open
data path (ODP). The path is closed, and all query resources are
deallocated, by using the Close File (CLOF) command.
This command is used to do any combination of the following
database
functions:
Join records from more than one file, member, and record format.
Calculate new field values by using numeric and character
operations
on field values and constants.
CL 400 ver 1.0

Introduction To CL
Programming
OPEN QUERY FILE (OPNQRYF)
Group

records by like values of one or more fields, and calculate

aggregate functions, such as minimum field value and average


field
value, for each group.
Select a subset of the available records. Selection can be done
both
before and after grouping the records.
Arrange

CL 400 ver 1.0

result records by the value of one or more key fields .

Introduction To CL
Programming
OPEN QUERY FILE (OPNQRYF)
Example : Selecting Specific Records
OPNQRYF FILE(ordfile) OPTION(*all)
QRYSLT('orddate=%range("840101" "841231")
& ordamt>100')
KEYFLD((ordamt *descend))
This command uses the QRYSLT parameter to select only records in the
first member of file ORDFILE that have an order date in 1984 and an
order amount greater than 100. Because the FORMAT parameter is
omitted, the open query file has the same record format as file
ORDFILE. The open query file allows all file operations (input, output,
update, and delete). The
KEYFLD specification is used to force the records to be arranged by
descending value of order amount.
CL 400 ver 1.0

Introduction To CL
Programming
OPEN QUERY FILE (OPNQRYF)
Five steps involved with Open query file are
OVRDBF

(File Name) Share (*yes)


OPENQRYF (FileA) Qryslt (Selection Criteria)
Call Pgm B
CLOF (FileA)
DLTOVR (File name)

CL 400 ver 1.0

Introduction To CL
Programming
OPEN QUERY FILE (OPNQRYF)
Is basically used for
Dynamic

record selection
Dynamic keyed access path
Dynamic keyed access path over join
Dynamic join
Mapped field definitions
Group processing

CL 400 ver 1.0

Introduction To CL
Programming
OPEN QUERY FILE (OPNQRYF)
For dynamic keyed access
OVRDBF FileA Share (*yes)
OPNQRYF FileA KEYFLD (CUST)
Call PGMB
For composite key KEYFLD (CUST DATE)

For dynamic access path over join file


OPNQRYF File (JoinLF) KEYFLD (Desc)

For dynamic join file


OVRDBF JOINAB TO file (FILEA) Share(*yes)
OPNQRYF File(FILEA FILEB) FORMAT (JOINAB)
JFLD((FILEA/CUST FILEB/CUST) MAPFLD (CUST FILEA/CUST)
CL 400 ver 1.0

Introduction To CL
Programming
OPEN QUERY FILE (OPNQRYF)
For Group processing
Group

processing allows summarization


A separate format is named
New format contains Grouping fields , constants , Aggregate
fields like %count , %sum , %avg , %max and min
OVRDBF File(GRPA) to file ( FILEA)
OPNQRYF FILEA FORMAT ( GRPA)
GRPFLD(CUST) KEYFLD(CUST)
MAPFLD ((COUNT %count)( AMTSUM %AVG))
CPYFRMQRYF command can be used to store the QRYF in
another object
CL 400 ver 1.0