|Standard task control variable. The company name
will be included at the top of each page. You
can disable this by either clearing it (
Y.COMPNAME$="") before calling
CDW038 or by setting the global variable
"$stdhead" which indicates a
standard page heading is to be used.
|If passed as a non-blank value,
Y5$ will appear in the page heading
on a separate row below the company name (if present) using style sheet class
present, or cell background color
#ccffff if not.
|If passed as a non-blank value,
Y5A$ will appear in the page heading
on a separate row below
Y5$ (if present) using style sheet class 'title' if present, or
cell background color #ffffcc if not.
HTML$ will contain the first page of output from CDW038
which contains the html table. If the output is being sent in an
email, then the output is typically printed to the channel opened by
CDS084 as in
PRINT (Y6.CH)HTML$. If the output is being displayed on a
web page, then after calling CDW038,
HTML$ is ultimately
which will send the output to the client browser.
HTML$ will be null if there are no records in
FILENAME$ that meet the conditions specified by either the
WHERE$ clause or
KEYEND$. In many cases, the line of code after
the call to CDW038 sets
HTML$ to some message when it comes
back from CDW038 as null, i.e.,
IF LEN(HTML$)=0 THEN HTML$="No
information to be displayed". In some cases it is beneficial to
WHERE$ expressing to assist in debugging, i.e.,
LEN(HTML$)=0 THEN HTML$="No information to be displayed using WHERE
HTML$ will contain error messages with white text on a
red background when CDW038 is unable to complete the task. See
error messages below.
|If Y then the number of records included in the report will
be show below the table.
|If non-zero, a blank row will be inserted after each table
row and before each call of
|External program called after each record is processed.
REC$ is the record just processed, and
HTML$ is the table prepared through this record. This option is useful when it is necessary to insert another table or other data below a table row.
|If non-zero, a blank row will be inserted after each call of
|If non-zero, blank lines using
<BR> will be added to the HTML at the end of the job
|If W, then after 100 records have been processed, the progress message "Preparing Report..." will be sent to the browser, and an asterisk after every additional 100 records processed.
This progress indicator can be used to prevent the client
browser from timing out and displaying an error page.
|Indicates the number of data table rows that should appear
on each page. After
CDW038 has built the html
table, it calls
CDW040 to separate the output into pages with links
at the bottom of each page to enable navigation to any specific
CDW040 for default values
W038.ROWSPERPAGE is passed as zero. Set
W038.ROWSPERPAGE to a negative number to cause the
html output to replace the current page, clearing any progress
indicators that might have been displayed as the report was
prepared. The maximum value is 9999. Warning: creating large pages with thousands of rows can cause out-of-memory errors.
|If non-zero, then the heading row with the column headings will be inserted in the table after every
W038.ROWSHEAD rows. Often set to 15 so that as the browser scrolls through the table, a heading row always appears somewhere on the view.
||Include the class= attributes in the row tags as shown in the table below. This option should be used when a reference to an external style sheet is included in the resultant HTML. Note that CDW999 will include a reference to the default style sheet if one is specified in Dynaweb Configuration Maintenance (WMS). Produces the shortest HTML code and is the preferred option when using an external style sheet can be used.
||Some email applications including Gmail and
Hotmail have limited support for cascading style sheets (css). Our tests indicate that these applications do not support external style sheets, nor styles based on a class or id. However, they do support inline style attributes located inside an html tag, as well as style tags contained in the
<head> section. This option will include a <style> section at the start of
HTML$ which includes table, and td tags. Row based styles will be specified within each <tr> tag.
||The class= references shown below will not be included within the row tags. Each row and cell tag will include attributes inline. This option creates the longest HTML so it should be used only when one of the other options cannot be used, as would be the case when the web page or email contains multiple tables with different styles.
|Class names used by CDW038 and can be specified by an external style sheet
||Top row which contains company name &
||Title row which contains
||Column heading row which contains column headings
||Odd numbered rows
||Even numbered rows
||Footer row which contains
|When using the report as a form for data entry, i.e.,
DISP$ options segment described below includes an "I",
INPUTROW$="Y" causes the row number to be
appended to each field name. For example, a field named
POINTS will become
POINTS3, etc. so that each row in
the table has unique field names. This is often the
preferred option as it is easier to process the form. In
addition, the total number of rows will be returned in
CGI.WMS_ROWS$. You may also want to set
W038.ROWSPERPAGE to a high number to prevent pagination.
|6 character background color to be used for top row of the
table. Top row contains company name from
SUBHEAD$ passed to CDW038 below the company
name. If using a standard page heading specified using the
"$stdhead" global, then the company name is
excluded from the row. You can also set
before calling CDW038 to suppress the company name. If not
passed, the default background color of
used which is a light yellow.
|6 character background color to be used for the title rows
of the table. The title rows appear below the top row and
contains the information from
passed to CDW038. The default color is
which is a medium yellow.
|6 character background color to be used for the column
heading row of the table. The column heading row appears
below the title rows. The contents of the column headings
comes from the template but can be overridden using the
TITLE slot in
DISP$. The default color
FFFF66 which is a dark yellow.
|6 character background color to be used for sub-total rows.
The default color is
FFFF99 which is a medium
|6 character background color to be used for the report total
row. The default color
FFFF66 which is a dark
|6 character background color to be used for the footer row
of the table. The footer row appears at the bottom of the
table and is used for
FOOT$ and links to page
numbers within the document. The default color is
FFFF99 which is a medium yellow.
|Used to specify the class of the html table. This
class should be defined in the style sheet. If not passed,
then the style sheet for the 'table' tag will be used.
The text to be added to the base
Script Name) when using hypertext links. For example, set
W038.PLINK$="p=WA012" to run program
WA012 when link is clicked.
Dynaweb typically uses the
p variable in the link
to designate the program to be run, after
performs basic web initialization.
also be used to pass other field values to the linked program.
For example, if the program needs a temporary work file named
by the initial program, you could pass the work file name to the
linked program WA012 in
PLINK$ as in
The linked program can them determine the work file name by
If the linked program also
calls CDW038 to display records from the temporary work file,
then it will retrieve the work file template from the data
dictionary. If the linked program does not use CDW038,
then you can open the temporary work file and obtain the
template using the
"D" option in the fifth
PAR$ when calling
If the Data Dictionary
file name for the work file is
then the following code can be used to read records from the
temporary work file:
The file name of the primary data file. The file can be type MKY,
SKY, or DIR and requires a template.
will be opened using either
MODE$ is specified, then
SELECT will be used and
KEYEND$ will be ignored.
KNUM of the file to be used. Ignored if
MODE$ is used.
The starting key or partial key in
passed as null, then the first record in the file will be used.
The ending key or partial key in
FILENAME$. If passed
as null, then
KEYEND$ will be the same as
For example, in a file where the primary key includes a customer#, date,
and invoice#, you could pass
KEYBEGIN$ as the customer#,
KEYEND$ as null. All records in the file with the
first part of the key matching the customer# passed will be included.
DISP$ contains field names to appear in the html table. Each field is separated with the | symbol, and any optional elements of the field are separated by the \ symbol.
The complete format of each field is
Each of the segments are described below.
|This field typically contains only a field name such as
CUSTNO, NAME, DESC1, etc. If |
FILE. is not
specified, then it is assumed that the field occurs in the
primary file specified by
However, CDW038 can also include fields from related files.
Related files can be used when the primary key of the related
file is a single field with the same name as any field in the
primary file. For example, if the key of the primary data
file is CUSTNO+DATE+INVNO then all fields in the customer file,
such as the customer name could be referenced by XXCM01.NAME
where XXCM01 is the file name of the customer file. See
additional examples below.
FILE. can also be a program name, which will be
called with an argument list of
Y$ is the standard task control variable,
PRIMARY$ is the templated data structure for the
primary file (
is the templated data structure returned by the calling program.
The option is useful when certain calculations or file access is
required to provide the data to be included in the output.
If the called program exits with an error 99,
then this signals CDW038 to skip this record. This
technique can be used when the conditions to include a record is
based on some calculation or other logic from an external
program that you can write. The programs output fields
must be defined in the data dictionary using the program name as
the data dictionary file name.
If this field simply contains * then all fields (and all
indexes of any repeating fields) will be included using the
asterisk can also be used to include all fields in a related
file or called program as in
[INDEX] specified on repeating fields to
indicate the specific
INDEX desired, such as
[ALL] may also be specified
as a shortcut for including all indexes of the repeating field.
When the repeating field has 12 elements where each element
represents one month you can specify an
TITLE element (below) as
Mth to cause short month names (Jan, Feb, Mar, ...)
to be used as the
TITLE for each column, or
Month to cause long month names (January, February,
March, ...) to be used as the
TITLE for each
TITLE is derived from the template
and passed here as null, however you may override the
TITLE by passing it in this position of
You can also use the
TITLE segment to create a hyperlink for
the column, typically provided to enable sorting by column.
For example, to provide a hyperlink to program xxxx and pass
variable col as 'NAME' specify the
as well as other arguments necessary to create the report such
as arg1 and arg2:
Should the operator click on this link, then program xxxx will
run which can check the value of the col variable and sort the
data by the desired column.
MASK is also derived from the
template and passed here as null, however you may override the
MASK by passing it in this position of
Since the template mask size may not be large enough for
sub-totals or totals, a mask larger than that in the template is
often used. Date and time masks can also be used for date
and numeric time and elapsed time fields.
For string variables, mask segment can also be used for a
sub-string expression, instead of a mask. For example, the
mask segment could contain
Normally, CDW038 will create a separate column for each
field, with one row of data per record. You can start
another row using the same data record by specifying the
OPTIONS element can contain the following
characters. Any other characters are ignored.
|T||Total this numeric field. Totals are displayed in the last row of the table.|
|Sub-total and total this numeric field|
|Sub-total but do not total this numeric field|
|Display field as blank if same as value in previous
row. This can improve the readability of the
output by not repeating the same value over and over,
especially in the leftmost columns of the output.|
|(Lower case L) Override default field alignment and
left justify this field|
|Override default field alignment and right justify
this field. |
CDW038 will right justify
all numeric values by default.
|Override default field alignment and center this
CDW038 will center by default,
all date and time fields, as well as fields where the
maximum field length is 5 or less.
|Do not wrap the contents of this cell to multiple
|Create a hyperlink for this field. The link
value for date fields is always in julian date format.|
W038.PLINK$ begins with "http", then the
link starts with
W038.PLINK$ does not begin with
"http", the the link starts with
SCRIPT_NAME includes a "?" then the link will
include all characters through the last "?" followed by
W038.PLINK$ otherwise a "?" and
W038.PLINK$ is appended to the link.
LINKNAME element is not
specified, then the current field name and value is
appended to the link, as in
LINKNAME is specified, then its field
name and optionally its value are used in the link instead of the
current field name and value. See Segment 8
LINKNAME for more details.
All template field types are supported including C,
N, U, etc. Leading and trailing blanks are removed
from the link value for C type fields.
A typical field with a link will result in html code
|b||When used with the L hyperlink option, the lower
case b indicates that the hyperlink should include
"target=_blank" so that clicking the link will cause the
resultant page to appear in a separate browser window or
|p||Indicates that the cell data may also include cell
formatting data, which precedes the data and is
separated from the data using the pipe (|) character.
This feature allows the programmer to change the colors
or other attributes of cells conditionally based on data
values. The valid cell formatting options are
|use monospaced font|
|background color xxxxxx|
|foreground (text) color xxxxxx|
|set fonts size to xxx|
|blank followed by text||adds text to cell style tag|
For example, if the data field contains "
font-family:Courier|Shipped", then the cell data
(Shipped) will be displayed in bold (b), with a red cell
background (gff0000), in the Courier font. The
html text generated will be:
|m||Use a monospaced font for this column. Only applies when either the |
'p' option described above is not used, or if it is used, then there was no style specifications included in the data cell.
|z||Show zero value numbers as blank|
|I||Use an input tag for operator entry in this field.
The input will be type text, with a name equal to the
field name, with the size and maxlength set to the field
size, and the value set to the current field value.
Example html: |
<input type='text' name='POINTS'
size=4 maxlength=4 value='7'>. Note the
HTML output of CDW038 will require a
<form> tag and
attributes, a submit button, and a
</form> tag to make
the web page a form that can be submitted and processed
by a bbx program.
|H||Create a hidden input tag for this field.
Hidden input tags are included in |
like non-hidden inputs. This is useful when using
CDW038 to create an input form. A key field or
other row identifier can be marked with the H option to
facilitate identifying the record key value when
processing the form. Note that the H and I options
cannot be used on the same field.
The contents of Segment 6 depend on the field type in Segment 1.
This segment is used when there are multiple records from a related
file to be included. It should contain the
WHERE clause used by the
SELECT verb to retrieve the related records. If more than one
field is to be retrieved from the same file, only the first field in
that related file needs this segment. Any data provided in
subsequent fields for the same file will be ignored.
WHERE clause can only refer to fields located in the primary file or the related file. It cannot refer to fields derived from a related file, nor from fields derived from an external program.
The fields from the primary file do not need to be qualified with the file name, so if file
XXIM01 contains field
ITEMNO, then these are all equivalent:
For example, if the primary file
XXIM01 contains items, and related file
XXUM21 contains warehouse records with multiple records per item, to include all warehouse records for an item and show
the warehouse code and quantity on hand from the warehouse file:
You may have multiple related files with
WHERE clauses in the same
Use option letter
's' described above to skip (exclude) the primary record when
there are no records that meet the conditions of this
|Program name||When using externally called programs, normally the primary
record is passed as input to the called routine. This
segment can be used to instruct CDW038 to pass one of the
related file records to the called routine instead. Place
the file name of the record to be passed in this field, i.e., |
SORTBY is only used in conjunction with the
WHERE option above and can be used to alter the
sequence of the records processed in the related file. For
example, to change the sequence of the related records from the
default warehouse code sequence to have the warehouse records
with the highest quantity-on-hand shown first, then pass a
SORTBY element as
ADJN(-EXT.QOH) where the
related external file is referred to as
QOH is the field name for quantity-on-hand.
ADJN() function is used when sorting numeric
fields. The leading "-" will change the sequence to
This element is only used in conjunction with the
(link) option described above. It is needed when the
hyperlink needs to refer to a different field name than the
LINKNAME does not exist within the primary record, then the link field name is changed from the field name to the
LINKNAME. For example if the field name is
SONO and the value is
12345 then normally the link url would contain
...sono=12345. But if
LINKNAME is set to
orderno, then the link url would contain
LINKNAME does exist within the primary record, then both the link and the value contained within the url link are set to that of the
LINKNAME field. This feature is useful when the identifying key to the record is not a field displayed on the web page. For example, an internal ID of field name of
SICNO is not included in
DISP$, but that field and its value are needed in a hyperlink. The hyperlink could be attached to the
SERIALNO field by setting
SICNO. Clicking on the hyperlink attached to the
SERIALNO field, will result in a url that contains
CDW038 normally uses arguments
KNO, KEYBEGIN$, and
KEYEND$ to determine which records in the file to be included. When the records desired cannot be accessed using that method, then a
WHERE clause can be provided, which will use the
SELECT verb to determine the records to be displayed.
Note that when using a
WHERE clause, the
KNO, KEYBEGIN$, and
KEYEND$ arguments are ignored.
WHERE clause can only refer to fields located in the primary data file. It cannot refer to fields in related files, nor fields
derived from a called program. In that situation, you can either
create and populate a work file, then pass the work file name to CDW038.
In some cases you can use CDS038 to create a
The fields within the
WHERE clause do not need to be qualified with the file name. If primary data file
XXIM01 contains field
ITEMNO, then the following are equivalent:
WHERE$ is a string, any quotes contained within the string must be doubled:
WHERE$ = "STATE$=""OH"" and SALES>0"
WHERE clause refers to fixed length numeric
U(3), I(3), N(6), you may achieve improved performance by using the string
representation of the field instead of the numeric.
For example if the
DATE field is a
U(3) template type, then use:
WHERE$="DATE$>="""+BIN(JUL(2007,1,1),3)+""" AND DATE$<="""+BIN(JUL(2007,12,31),3)+""""
WHERE$="DATE>="+STR(JUL(2007,1,1))+" AND DATE<="+STR(JUL(2007,12,31))"
Typically the data range is specified using variables, so if
TODATE are the FROM/TO dates in julian format, then the following example could be used:
WHERE$="DATE$>="""+BIN(FRDATE,3)+""" AND DATE$<="""+BIN(TODATE,3)+""""
The best practice is to use hexadecimal constants so that the
WHERE$ clause does not contain any binary characters:
WHERE$="DATE$>=$"+HTA(BIN(FRDATE,3))+"$ AND DATE$<=$"+HTA(BIN(TODATE,3))+"$"
Using a defined function can simplify further:
def fnd$(jdate) = "$" + hta(bin(jdate,3)) + "$"
where$ = "DATE>=" + fnd$(frdate) + " and DATE$<=" + fnd$(todate)
Optional sortby clause also used with
SELECT verb to
control the sequence that records are displayed and to create sub-total
Note that you must use
SORTBY$ in order to
create sub-total rows, even when the data file is pre-sorted.
Field names referenced within
SORTBY$ that refer to the primary data file, do not require the file name, i.e., if the primary data file is
XXIM01 and contains field
ITEMNO, the following are all equivalent:
SORTBY$ can include fields contained within the primary file, fields contained in
related/external files, or even fields derived from a called program.
For example, to sort by
descending sales (a B type field) within state, pass
Note that when
SORTBY$ is used, then
KEYEND$ are ignored.
Sub-totals are enabled by including a
OPTIONS segment described above, and by specifying a
following the field name in
SORTBY$ such as
An unlimited number of sub-total levels can be enabled by additional
codes in the
SORTBY$ clause, i.e.,
MODE$ is passed to the
SELECT verb. The most popular use is for creating a log file describing the optimization logic used by
SELECT. To enable this option, pass
"debug=tmp/cdw038.txt", and a text file will be created with optimization data.
You can review the optimization data to determine how BBx chooses the
bests KNUM to use. You have some options to override the default
behavior of BBx by passing
Refer to the BBx documentation for the
SELECT verb for additional
details. Note that when
MODE$ is used, then
KEYEND$ are ignored.
|Optional limit to the number of records to be displayed. For
example, to limit the output to the top 50 customers based on sales, the
LIMITVAL would be passed as 50. Note that the
LIMITVAL can be used whether the primary data file is opened
can also be passed during testing to reduce the size or the time to
produce the output.
|This field can contain text that will appear in the first row, below
the company name (
Y.COMPNAME$). It might contain the
actual customer name or other report heading information. Multiple
lines can be passed using the html
<BR> tag as a separator,
Metal Mouldings<BR>Cleveland Division. The
SUBHEAD$ field uses the style sheet class 'top' or cell
background color #ffffcc if not using a style sheet.
FOOT$ can be passed to
CDW038 as html text
that is appended to each page of the
It typically would contain links to return to a menu and to logoff.
The footer text is placed in a separate row at the bottom of the table.
The style sheet class 'foot' will control the appearance of this row.
If not using a style sheet then
CDW038 will use a cell
background color of #ccffff. Example:
Entries</a> | <a href=""/cgi-bin/em.cgi"">Home</a> | <a href=""/cgi-bin/em.cgi?p=WA998"">Customer
Selection</a> | <a href=""/cgi-bin/em.cgi?p=WA999"">Logout</a> | [HELP]. Quotes are doubled since this text is within a BBx string.
|The bbweb environment variable which can be passed to
but is not currently being used.
Other attributes including the font color, may be also assigned using the
|Filename not specified
FILENAME$ is non-blank
|Invalid field name: _XXXX
||Field name shown is not supported in CDW308
|Formatting Error with field XXXXX
|Unable to locate external field named XXXX in any external
||Field name XXXX located in
DISP$ must be a
templated field contained within the primary record, a called
program, or an external file that can be accessed using a key
comprised of a single field.
|Missing field name at XXXX
||Check to be sure there is a | symbol separating each field in
|Index value of XXX is invalid for field name XXXX in file XXXX
||The index for a repeating field exceeds the number of repeating
|CDW038 does not yet support the subtotal sortby expression XXXX
SORTBY$ syntax. Be sure string
variables include the
|Field name XXX is an invalid template field for file XXXX.
||Verify that the field name specified is contained in the
template file if file XXXX is a data file, or in the data dictionary
if XXXX is a program.
|Error XX selecting records to be printed, with a table that
includes FILENAME$, template, DISP$, WHERE$, Revised WHERE$ (after
pre-processing), SORTBY$, Revised SORTBY$ (after pre-processing).
||This error indicates that a field specified in
SORTBY$ is not valid, or these clauses contain an
invalid character, or in some cases, the fields in a record are too
short to build the key for sorting. If the fields being sorted
are variable length, you may need to pad them out using expressions
|Error XX selecting records from related file, including table
information as described in above row
||Verify that the
clauses contained in
DISP$ are valid for the related
|Error XX trying to open file name XXXX and retrieve template
||Unable to open primary data file
retrieve template from global memory, template file, or data