File Manager 22.2 Getting Started Manual

Contents > Appendix A

Appendix A: Sort and Print Qualifiers

Sort Qualifier Reference

The following table illustrates the sort qualifiers you can use at the “SORT BY:” prompts:

Qualifier Action Discussion
!field Number entries by sort value Entries having the same value for the SORT BY field are numbered sequentially starting at one.
#field Page break when sort value changes Starts a new page every time the value of the sorted field changes.
'field Specify a range for output without sorting Lets you select entries based on this field in the "START WITH . . . GO TO . . ." dialogue, but not sort based on the field.
+field Subtotal within a SORT BY field You can sub-subtotal by adding a prefix of + to two fields in the "SORT BY:" dialogue. For example:
SORT BY: +REGION
WITHIN REGION, SORT BY: +STORE
This produces subtotals for each STORE within the subtotals for each REGION.
-field Reverse sort order Only effective for NUMERIC and DATE/TIME valued fields.
@field Suppress the printing of subheader Normally, a subheader with the value of the SORT BY field name is printed if the field is not also specified as a print field.
field;Cn Set column of subheader The number (n) indicates the column to begin the subheader.
field;Ln Use less than the entire sort field for sorting The ;L suffix lets you specify that only the first "n" characters of the field be used to sort. Thus, if you specify:
SORT BY: NAME;L2
Only the first two letters of the name field will be used for sorting. The order of "Maris,Roger" and "Mantle,Mickey", for example, will be unpredictable in your output.
field; Pa-b Store sort range for display The ;P suffix saves the "START WITH" and "GO TO" sort range for one level of sort fields, for later reference at a "PRINT FIELD" prompt. You can substitute any string (up to 60 characters in length) for "a" and "b" in ";Pa-b". Whatever strings you use as "a" and "b" (e.g., FROM and TO) become subscripts of the PARAM() array:
SORT BY: NAME;PFROM-TO
START WITH NAME: FIRST// C
GO TO NAME: LAST// Dzzzzz
Then at a "PRINT FIELD" prompt, you can reference the saved values by using PARAM("a-string") and PARAM("b-string"). Thus, in this case:
THEN PRINT FIELD: PARAM("FROM")
THEN PRINT FIELD: PARAM("TO")
The sort-from and sort-to values of "C" and "Dzzzzz" in the report would then print in the appropriate location. The typical reason to save sort values, and then retrieve them from the PARAM array in a print field, is for custom report headers (which are created as PRINT templates). It is one method to print sort criteria in the report header.

If you need to sort on two or more fields, you need to use a different string for "a" and "b" at each level, or else the values will overwrite each other.

No value is saved in the PARAM array if the user accepts "FIRST" or "LAST" as the "START WITH" or "GO TO" sort values; the PARAM array will be null.
field;Sn Skip lines when sort value changes The ;S suffix skips one line between sort field values, if no number is added. If you specify a number (n), n-lines are skipped. For example, here we sort by patients, but we ask that each time the patient value changes, we add 3 lines.
Output from what File: VISIT//
Sort by: VISIT/ADMIT DATE&TIME//
PATIENT NAME;S3
Start with PATIENT NAME: FIRST//
Within PATIENT NAME, Sort by:
field;TXT Sort numbers as text The ;TXT sort qualifier forces digits to be sorted as alphanumeric strings, not as numbers (22 sorts before 3). Use this to correctly sort mixed canonic and noncanonic numbers.
field;"xxx" Replace caption in subheader and sort dialogue The default subheader is the field label or expression entered at the "SORT BY:" prompt. The same string is used within the sort dialogue. You can substitute a string of your choosing by adding a semicolon (;) and text enclosed in quotation marks. For example:
SORT BY: DATE OF BIRTH;"Birthdate: "
To suppress the caption in the subheader, enter two double quotes after the semicolon:
SORT BY: DATE OF BIRTH;""
The specified caption is also used in the subsequent sort dialogue. This is useful in simplifying the sort dialogue when a field label is confusing, is concatenated, or is an extended pointer. For example:
SORT BY: STORE:REGION;"Location:"
START WITH Location: FIRST// <Enter>
WITHIN Location, SORT BY: <Enter>
PRINT FIELD: STORE
THEN PRINT FIELD:
"Location:" is substituted for "STORE:REGION".

The following table illustrates the print qualifiers you can use at the "PRINT FIELD:" prompts:

Qualifier Action Discussion
!field Count The number of entries with non-null values in this field are counted.
#field All statistics Use with NUMERIC fields only. Six lines of statistical output are generated for the selected field: Total, count, mean, maximum, minimum, and standard deviation.
&field Total Use for NUMERIC fields only. The values of all occurrences of this field are summed.
+field Total, count and mean Use for NUMERIC fields only. The sum, count of non-null values, and the arithmetic mean of the non-null values are printed.
field;Cn Set start column position You can specify the starting column of a field's display. If the number (n) is a positive number, the field prints in that column counting from the left margin. If it is negative, the field starts in that column assubtracted from the right margin. If there is not enough room on a line for the field to display properly, it is moved to the line below. Adding ;C1 always starts a field's display at the beginning of a line.
field;Dn Round decimal fractions Specify the number of decimal digits of accuracy with a number, “n.” If n=0, the number is rounded to a whole number. The number (n) must be > 0 or = 0.
field;Ln Left justify and truncate To left justify within a field width of “n” characters, follow the ;L with the number of column positions you want the field to occupy. If necessary, the data is truncated to fit into this length. Since non-numeric fields are left justified by default, the only effect of ;L on those fields is truncation. This qualifier does not affect DATE/TIME-valued fields.
field;N Suppress consecutive duplicate values If you do not want the same value for a field printed on consecutive rows of a report, add ;N to the field specification.
field;Rn Right justify text To right justify within a field of “n” characters, follow the ;R with that number. Right-justified data is not truncated; if “n” is not large enough, data spills into the next field's area causing confusing output. NUMERIC DATA TYPE fields are right justified by default. However, computed expressions with numeric results are not right justified automatically.
field;Sn Skip lines between fields You can indicate a number of lines to skip before printing a field by using ;Sn. Without a number, ;S skips a single line. If your field has a null value, “n” lines are skipped anyway. You cannot use ;S with a WORD-PROCESSING-type field. To skip one line before a WORD-PROCESSING field, precede the field with an additional print specification like this:
THEN PRINT FIELD: "";S
field;T Use field TITLE as header If you want to use the field's TITLE, as defined in the data dictionary, instead of its LABEL in the header, add ;T.
field;Wn Wrap text The ;W suffix splits a field that is too long for its field column width at word boundaries (spaces) and prints it out fully on two or more rows. You can optionally follow the ;W with the number of column positions to be occupied by each line of output. If the field's data dictionary definition says to always print in word-wrap mode, WORD-PROCESSING DATA TYPEs are automatically wrapped. The ;W suffix overrides the ;R or ;L suffixes; do not use them together.
field;X Suppress header and inter-column spaces Follow the field specification with ;X to suppress the two spaces normally inserted before a field and the column header for the field. The result is concatenation of the field with the field that came before it. The ;X suffix is often used to add a literal caption to a field.
field;"xxx" Customize header The default header for columns of a report is the field label (for fields) or a computed expression (for “on the fly” computed expressions). To change the header, follow the field label with a semicolon (;) and the column header you want. Enclose the header in quotes. When possible, spaces wrap the substitute header within a print width obtained from the field's data definition. For example:
THEN PRINT FIELD: DOB;"Date of Birth"
THEN PRINT FIELD: DOB;"Date_of_Birth"
The first specification prints the header on two lines; the second prints it on one line (with underscores). To suppress the header, add ;"" to the field.
field;Yn Set start row position You can start printing a field on any line on the page. If “n” is positive, the field is printed on that line as counted from the top of the page. If it is negative, it is printed on that line as counted from the bottom. When specifying ;Yn, you must account for any page header that is displayed.
"xxx" Insert a literal At the “PRINT FIELD:” prompt enclose a free text literal in quotes. The literal is inserted into the body of the report. For example, the following specifications begin each entry's display with a caption and NAME:
FIRST PRINT FIELD: "Patient's name:"
THEN PRINT FIELD: NAME;""
OR
FIRST PRINT FIELD: "Patient's name:"
THEN PRINT FIELD: NAME;X
The header for the NAME field is suppressed in both examples.
[return]