This program can be called to display records from a data file. Each record is displayed on one row. The display can include data from the main file, from one or more related files, and from other called programs. The records are displayed in a grid with graphical lines separating columns. The user can move up, down, left, right, to the first and last rows, and in some cases, jump to a position within the file. CDS037 can also be used to return an operator selected record from the list of records displayed, or to call an external program to process the selected record, then return to the record selection display.
The records are displayed in a window which is created and popped by CDS037. You can specify a fixed window size and position, or allow CDS037 to assume defaults.
CDS037 is called in several places by various Dynamo Tool components and applications:
- Display Software Versions (V menu option)
- Display Terminal Status (T menu option)
- File Utility (SMU menu) - Display/Maintain/Print Data Option (Display option)
Calling Format:
CALL "CDS037",FILENAME$ {,KNO, KEYPFX$, DISP$, WINX, WINY, WINROWS, WINCOLS, WINTITLE$, COLORS$, SELRTN$, WHERE$, SORTBY$,
S037$, LIMITVAL, SELREC$}
CDS037 uses either the KNO
and KEYPFX$
with an
OPEN ()
or WHERE$, SORTBY$, MODE$,
and LIMIT
with
SELECT()
. If none of the SELECT
arguments are specified then the
KNO
and KEYPFX$
will be used. Otherwise they are ignored.
CDS037 Arguments | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FILENAME$
|
the only required parameter and is the primary file to be displayed. See Example 1. A template must exist for this file. The file may be MKY, SKY, or DIR. It may also be IND if used with the
WHERE$, SORTBY$, MODE$ , or LIMIT options. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KNO
|
applies to MKY files only and controls the sequence that the data will be displayed when
WHERE$, SORTBY$, and MODE$ are null, and LIMITVAL is zero. If not passed to CDS037, then
KNO
zero will be assumed. See Example 4. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KEYPFX$
|
may be null or indicate the starting characters of the keys to be displayed. If
KEYPFX$ is passed to CDS037, only keys that begin with the
KEYPFX$ characters will be displayed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DISP$
|
DISP$ may be used to indicate the columns to be displayed. If not passed to CDS037, or passed as null, then all fields in the template for
FILENAME$ will be displayed in the same order as contained in the template.
If
Following each field name, you may specify additional positional arguments separated by back slash (\). The complete format for each field is:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WINX
|
can be set to the column where the upper left corner of the window border should be displayed. If not specified,
WINX will be assumed to be zero. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WINY
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WINROWS
|
can be set to the number of vertical print positions for the window. If not specified,
WINROWS will be computed to the bottom of the display less two lines for the prompt. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WINCOLS
|
can be set to the number of horizontal print positions for the window,
including the window border. If not specified,
By setting
By setting |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WINTITLE$
|
can be set to display on the window border. If not set, then no window title is used. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
COLORS$
|
can be used on color terminals to override the default colors. By default, the colors used are those specified in Operator Preference Maintenance for Display (F2). If different colors are preferred, then
The chart below lists several
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELRTN$
|
In some cases, it is desirable to allow the operator to select a record, call an external routine, and then exit back to CDS037 to allow selection of other records. You invoke this feature by specifying
SELRTN$
as the program name to call when a record is selected. When this option is used, CDS037 will
CALL SELRTN$ with Y$,SELREC$,L
as parameters. You may access the current window if desired.
The selected record is at line L .Alternatively you may print another window, then Note: the You may modify If you do not change the record, but want CDS037 to redisplay the record, because of related file display, or external programs referenced in
In some cases, you may need to modify more than one record in the
file, or even add records to the primary data file. In this case
return
CDS037 creates a work file whenever it needs to use In most cases, you can do what is necessary within the record selection routine. There is another option of CDS037 that actually exits CDS037, passing you the
You can also pass When |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
WHERE$
|
The following four parameters If there is a
If the Note that the |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SORTBY$
|
is used when special sorting sequence is desired. You may use
When sorting by a numeric field, use the functions listed below: For U type fields, use the string version of the field name as in
When a segment of a sortby key must be descending, add the |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
S037$
|
Prior to 4/13/2010, this field only contained MODE$ .
Programs passing only MODE$ to CDS037 will continue to work
the same. Use the CDS037 template to pass any of the new
parameters to CDS037.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LIMITVAL
|
is passed to the SELECT verb to limit the number of records displayed. If not passed to CDS037, or passed as zero, all records meeting the conditions specified in the
WHERE$ parameter will be displayed.
It can be set to a number during testing to reduce the time to process
all matching records. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SELREC$
|
Set by CDS037 as the primary file record selected by the operator.
Note that when |
Using Related Files
There is no limit to the number of related files that can be used. No error occurs if CDS037 is unable to locate a record in a related file. These fields will be blank or zero.
With DISP$="ORDERNO|CUSTNO|XXUM10.NAME"
, the field NAME
will be displayed from file
XXUM10
.
The following assumptions are made about the relationship between the main file and the related files.
- The key to the related file must be a single field that has the same name as that in the main file template. In this example
KNUM=0
of fileXXUM10
isCUSTNO.
- The key to the related file must be the first field of the related file.
- If the related file is MKY, then the key for
KNUM 0
is used.
Note: CDS037 can use fields in related files to access other related files. For example, consider the files and fields:
File Name | Field Names |
---|---|
SO01 - Sales Orders |
ORDERNO, CUSTNO
|
CM01 - Customers |
CUSTNO, NAME
|
SM01 - Salesmen |
SLSNO, NAME
|
DISP$
set to "ORDERNO|CUSTNO|XXCM01.NAME|XXCM01.SLSNO|XXSM01.NAME"
will display the salesman name from the salesman file even though the salesman number is not on the order file. There is no internal limit to the number of files that can be accessed. In effect, for every related file that is accessed, all fields in that file can be used as keys to access other files.
Using Called Routines
There are many situations where special formatting or access to other files requires a called routine. CDS037 can call an unlimited number of routines for each record to be displayed. These routines return a populated string template to CDS037 containing one or more data elements. The
ENTER
statement in the called routine should be:
ENTER Y$,REC$,PROG$
Y$
|
Standard task control variable |
REC$
|
Templated record associated with main file: FILENAME$ . Usually named with last four characters of file name, i.e.,
VM60$ |
PROG$
|
Templated record associated with this called program. Usually named the same as the program name, i.e.,
VM601$ . |
The called program must have a template associated with it. However, CDS037 can access the template from the Data Dictionary: A template file on the disc is not required. Refer to
CDS041 for template search logic. CDS037 will retrieve the template for the called routine and pass it in
PROG$
. The called routine does not need to initialize the template.
Note: CDS037 will only call each routine once, even if it is referenced in DISP$ multiple times.
In some cases the called routine needs data not specifically contained within
REC$
. When operator entries are needed by the called routine, they can be stored in global variables for access within the called routine.
Example 5 uses a called routine to add up each of the 12 months and have CDS037 display the total.
Note: CDS037 cannot compute totals and sub-totals like CDS038 does. However, you can write a program that does all the computations, stores the data in a file, then calls CDS037 to display the data, including the sub-totals and totals contained within the file.
Example 1 |
---|
CALL "CDS037","SM91"
|
|
Example 2 |
---|
CALL "CDS037","SM90",0,"","REQID|FAXNO|OPERID"
|
|
Example 3 |
---|
This example demonstrates how to display data from a related file. |
CALL "CDS037","SM91",0,"","REQID\Req#|ATTEMPT|SM90.FAXNO\Fax#|SM90.OPERID\Operator ID"
|
![]() |
Example 4 |
---|
This example demonstrates use of a key prefix and a display string indicating the fields to be displayed. |
CALL "CDS037","SM90",1,BIN(JUL(2007,7,18),3),"QDATE|QTIME|REQID|OPERID"
|
![]() |
Example 6 |
---|
This example demonstrates use of date and time masks. |
CALL "CDS037","SM90",0,"","QDATE\Date\%Ds %Ms %Dz|QTIME\Time\%Hz:%Mz|REQID\Req#\####|OPERID\Opr\XXX"
|
![]() |
Multi-Line example using B option |
CALL
"CDS037","EXIM01",0,"","ITEMNO|DESC1\Description|DESC2\\\B|PCL"
|
![]() |
Multi-line example using W option |
CALL "CDS037","EXIM01",0,"","ITEMNO\\\W35|DESC1\\\B|DESC2\\\B|PCL"
|
![]() |
Example using the F5 option |
CALL "CDS041","CDS037",S037$,"YY"
|
![]() |