List Command [L]

Prints lines of the current workfile, an external file, a spool file, or a Copylib member, either on your screen or to a printer file.

LIST [$option...] [ rangelist ]

(Default: rangelist = *)

LIST [$option...] filename[,UNN] [ rangelist ]

(Default: rangelist = ALL)

(Q=no linenums, T=template, J=jumping)

If you do not specify a filename, List displays lines of the current workfile. If you do specify a filename, List displays lines from that file without Shutting your current workfile. You can refer to the “previous” file by a shorthand method, a “$”.

If you specify a single line number as a rangelist and that line does not exist in the current file, Qedit’s action depends on the Set List Nearest setting. If the option is Off, the default, Qedit displays a No Line warning. If the option is On, Qedit displays the nearest line. For example, if lines 100 to 120 are missing from a file, here is what would happen:

  /List 100  Warning: No Line  /Set List Nearest On  /List 100     121    This is line #121.  

If you are trying to do something similar on an external file, Qedit does not display anything.

Specify filename,UNN when listing a data file which has numeric characters in the last 8 column positions and they are not valid sequence numbers.

When you list lines of your current workfile, Qedit shows only the columns within the current left and right margins, and the default rangelist is the current line (e.g., List = List *). When you List an external filename, margins are ignored and the default rangelist is ALL.

Examples

  /list 5              {display line 5 only}  /listq 5/            {List-Quiet from 5 to Last}  /list "customer"     {all lines containing "customer"}  /list -5/+5          {display current vicinity}  /l r23gl.src         {display entire source file}  /l r23gl.job ]-10/   {print last 11 lines of job file}  /l $ "$page"(1/5)    {"$page" in column 1 of previous file}  /set left 55;set right 132  {set margins in wide file}  /listt all           {show template above columns}  /list "bob"  (upshift)      {"bob","BOB","Bob",etc.}  /list "@UPD@MAST@" (pat)  {strings UPD and MAST both in line}                               {pattern matching}  

$-Options

You can configure permanent options for the List command using Set List; you can also select temporary options within a specific List command. The temporary options are preceded by a dollar sign.

LIST [ $option ... ] [ filename[,UNN] ] [ rangelist ]

The temporary $-options come after the command name and before the external filename and rangelist.

Here are the $-options accepted in the List command:

[$lp | $lpa | $lpb | $record ] Overrides default output to $stdlist. $lp, $lpa and $lpb send output to a file with the same name as the option. $Record sends output to LPCRT=$stdlist via Record mode.
[$DEVice filename] The $device option sends output to the specified file name. If the file name is not equated to a particular device, the output is sent to that file name. If the file name is redirected with a file equation (file filename;dev=printer), then the output is sent to that device.
[$HEX | $OCTAL | $DECIMAL] Numeric dump
$CHAR Remove garbage; combines with Hex/Octal/Dec
$PCL code LaserJet fonts and orientation
$DUPLEX Double-sided printing on certain LaserJets
$EVEN | $ODD Outputs even or odd number of pages
[$COLUMNS (range, ...)] Lists only certain columns
The $columns option allows you to list only the contents of certain columns. You can specify up to four column ranges. The ranges have to be enclosed in parentheses and can be separated by commas or spaces.
A range must have a start column and, optionally, an end column. If only a start column is specified, the end column is assumed to be the same. In this case, Qedit lists only one column. For example
/List $columns (5) {lists only the contents of column 5}
/List $columns (5/10) {lists the contents of columns 5 to 10}
/List $columns (5 20/30) {lists column 5 and 20 to 30}

Column numbers must be valid for the Language of the file. For most files, the first column is 1. For COBOL-type files, the first column is 7. Column numbers must also be within the current left and right margins. The column numbers do not have to be entered in a particular order. For example, the column numbers in the first range can be greater than the column numbers in the second range. The text appears in range order (i.e., range1, range2, range3 and range4). The same column can be included in multiple column ranges. The total number of columns listed cannot exceed the absolute line length maximum (8,172 characters).
Although a template Listing is allowed with $columns, the output might not be very helpful. For example,
/LT $column (15/20)
+....2
1 O
2 pp
3 QQQ
4 rrrr

List $include is supported with $columns, but included files are treated as if they are the same type as the main file. For example, if you include a COBOL file within a Data file, the COBOL file will start at column one.
You can specify a rangelist (e.g., a search string with $columns). Qedit first searches for the string, which can appear anywhere on the line, then applies the $columns specification.
$DOUBLE Double space the listing (or $DBL)
$SHIFT Shift the listing four spaces to the right
[$RIGHTBY spaces] Shift the listing to the right by the number of spaces
The $rightby option works like the $shift option. It allows you to shift the printed output to the right. The $shift option shifts the output by four spaces. The $rightby option allows you to specify the number of spaces by which the output is shifted. This number can be between 1 and 30.
/List $shift LP {shifts output by four spaces}
/List $rightby 4 LP {also shifts output by four spaces}
/List $rightby 20 LP {shifts output by 20 spaces}
$INCLUDE List/search $include files as well
$USE List/search usefiles as well
$COPY List/search COBOL Copylib files as well
$PAGE [ ON|OFF ] Override Set List Page option
$LINES count Override Set List Lines (per page)
$PRE | $POST Override pre- or post-spacing (default)
$SKIP | $NOSKIP Override skip (default) or noskip on perf

Here is an example that uses three of the $-options:

  /list $lpa $double $shift all  

This command would list all of the current file to the LPA with double spacing, and the listing would be shifted four spaces to the right. The file LPA defaults to Dev=LPA, but you can use :file lpa;dev=serialp to redirect it.

When listing an external file, the $-options must come before the file name:

  /list $hex $char filename     {hex-char dump of file}  

Include Files

Normally, Qedit only searches the current file for a string. If you specify the $include keyword, however, Qedit will also search the $include files for the string.

  /list $include "global_variable"  

The lines that specify Include files must begin with either “$”, “#”, “!”, or “.”. In SPL programs, an exclamation point indicates that the rest of the line should be treated as a comment. So, if a line starts with an exclamation point followed by the word Include, Qedit also assumes this to be a comment and not an actual Include statement.

The $include command must be spelled out in full, and it can be indented from the prefix character ($, #, etc.). The prefix character can be in any column as long as it is preceded by spaces only. Even though Qedit allows prefix indentation, other programs such as compilers might require prefixes to be in specific columns e.g. column 1.

So, as far as Qedit is concerned, the following examples are valid Include source lines:

  $include 'globals.source'      $include constant.srcinc      $    include headers  #include <strings.h>  #include "parser/bnf.c"  !   include somefile  .include    chapter1.book  

You cannot combine the $use and $include options.

Usefiles

The $use option is very similar to the $include option. If you specify the $use keyword, Qedit will also search any usefiles for a string. Usefiles are commonly used in PowerHouse source code, Qedit and Suprtool command files, and jobs streams that run Qedit and Suprtool.

  /list $use "data.def"  

The lines that contain the “use” directive must have the word “use” as the first word in the line. Leading blanks are allowed. Everything after the word “use” is assumed to be a file name.

You cannot combine the $use and $include options.

COBOL Copylib

The $copy option is very similar to the $include and $use options. This option works with files of Language COBOL, COBX or COBFREE. It does not have any effect on files with other languages.

If you specify the $copy keyword, Qedit scans all the lines in the rangelist for the word Copy anywhere in columns 8 to 72 (columns 1 to 256 for COBFREE files). Qedit assumes the next word on the line is the member name. It then looks for an In or Of clause. If there is one, Qedit uses the next word as the library name. If there is no In and Of clauses, the library name defaults to Copylib.

Qedit will also search any COBOL Copylib files for a string.

  /list $copy 9/10           {list all Copylib members found}                             {in lines 9 through 10}  /list $copy "CUSTREC"      {list all lines containing the string}                             {also scans Copylib members}  

You cannot combine $copy with $use and $include options.

$Device Option

The new $device option is very similar to the $lp, $lpa, and $lpb keywords.

  /list $device printer @  

The above command opens a file called Printer and sends the list output to it. To redirect the output from the List command to a printer, you must specify a file equation to a valid device.

  :file printer;dev=laser  /list $device printer  

If both the $device and $lp keywords are used, the $device takes precedence.

Configuring Printers

By using :File commands in your Qeditmgr file, you can define LP, LPA and LPB as three different printers on your system. The default device class is LP, if no file equation is specified.

  :file lp;dev=lp  :file lpa;dev=serialp  :file lpb;dev=33  

Merging Options

The $-options in the List command are merged with the Set List options, except that Set List Record ON applies only to the file LP, not LPA and LPB. The $-options can be combined wherever they make sense; they can be used with Jumping, Quiet and Template, and can work on the current workfile or an external file. $-Options may be shortened (e.g., $h = $hex).

Interrupting a Listing

Press the Control-S key to “pause” the listing for review. Then, press Control-Q to resume the listing. On newer HP terminals, the Stop key pauses a listing until you press Stop again. To stop the List command, press the Control-Y key.

Listing External Files

With the List command, you can look at any file on a system to which you have read access security.

  /list catalog.pub.sys  

Qedit studies the file and determines whether it has sequence numbers or not. If you ask for a rangelist of lines, Qedit implicitly numbers a file without numbers. It starts at line 1.0 and adds the current Set Increment value. If the file has sequence numbers, Qedit uses them, unless it finds illegal numbers or numbers out of sequence. It then prints the following message:

  Error: line number out of sequence (001200) - renumbering the rest  

The string in parentheses is the incorrect line number. You should make sure it contains numeric digits only and that it is greater than the number on the previous line. To check this information, you should text the file using the Unnumbered option.

After reporting the information, Qedit then assigns new numbers to the lines, starting with the last valid number and adding the current increment.

Qedit uses this shorthand character to refer to the most recent external file name: “$”. For example,

  /list abc.source "$page"(1/5)  /list $ 500/600  

Because Qedit uses “LP” as a reserved keyword in this command, you must use a :File command if you want to list an external file named LP.

  /:file xyzzy = lp  /list xyzzy  

Listing Temp Files

Normally the List command looks for either a temporary file or a permanent file with the specified name. To list only a temporary file, append the Temp keyword to the file name:

  /list output,temp  

You can append more than one keyword to the file name:

  /list filename,temp,unn  

Listing Output Spool Files (NM)

On MPE XL 2.1 and later, spool files are now regular files that can be listed in Qedit. To make this easier, Qedit converts the spool file numeric format (i.e., #o1234) into an MPE file name for you. You can omit the “o” if you like.

  /showout  /list #o1234  /lqj #456  

Pre- Versus Post-Spacing and Skip-on-Perf

If you Text a spool file into Qedit and then reprint it using LQ, you may find that the file has switched from pre-spacing to post-spacing or from noskip-on-perforation to skip-on-perf. These are the defaults, and the information to override them is sometimes hidden in the spool file where Qedit cannot find it. Similar problems may occur when editing CCTL disc files.

List has the $pre, $post, $skip and $noskip options to deal with these problems.

  /listq $pre $lp all         {pre-spacing on LP}  /listq $noskip $rec all     {on attached printer}  /listq $pre all
  {on $stdlist}  

A program selects these printer options by using a carriage control code. The codes can be specified in two ways: either through the Fwrite intrinsic, or the Fcontrol intrinsic (in this case they do not show up when Qedit Freads the spool file). Here are the four CCTL codes:

  Char Dec Octal Hex
Post-spacing ” “ 64 %100 $40
Pre-spacing “A” 65 %101 $41
Skip-on-perf “B” 66 %102 $42
Noskip-on-perf “C” 67 %103 $43

Listing Copylib Members

To display a member of your Copylib file, you just put the member name in parentheses. You don’t need to mention the name of the Copylib itself if you have a :File command for “copylib”. Otherwise just put the file name after the member name. For example,

  /file copylib=copylib.pub.develop  /list (custrec)  /list (custrec) copylib.test.develop  

To list the member names in the Copylib, instead of the members themselves, specify a pattern instead of an actual member name.

  /list (b@)      {names starting with "b"}  /list (@)       {all the names}  

Quiet Listing and CCTL

LQ means list without showing the line numbers. When you use LQ to list a file that has CCTL (carriage control), Qedit uses the first column of each line as carriage control. Thus, Qedit can reproduce application reports which were redirected from LP to Disc (using :file list = xxx, new; cctl ;dev = disc) with exactly the same spacing and paging that was used originally. Workfiles may also have CCTL (see Set Keep and Verify Keep).

Template Listing

The LT command prints a column-number template before the first line of the listing.

  /lqt 5  ....+....10...+....20...+....30...+....40...+....50..      training of Qedit users is so easy that you will  

Remember that the first column number in a standard COBOL source file is column 7, not column 1. For a COBFREE file, the first column is 1. In addition, if you have done Set Left and Set Right to define margins for your file, the template starts with the Left margin column and ends with the Right margin column.

  /set left 20;set right 41  /lqt 5  20...+....30...+....40  it users is so easy th  

Browsing or “List-Jumping”

When you add “J” to “List” it means list-jumping. This lists the lines specified, but stops every 23 lines (this pause is handy at 19.2K baud). Browse quickly throughout a file, viewing as much or as little of each section as you like. The default rangelist for ListJ is */Last, and ListJ linenum means start jumping at linenum. You can go into Browse mode quickly from Line mode by using the function keys. Press F6 to start browsing at the current line, press F5 to browse starting back a page, and press F2 to roll the screen forward a few lines before starting to browse.

At the end of each screen, ListJ prompts you for “what to do next?” and waits for your reply. If the user presses Return or F6, or types “yes”, Qedit displays the next screen. If the user presses F8 or Control-Y, or types “no”, Qedit stops the listing. If the user types a line number, a string, or a relative line count (e.g., -50, +5), or presses F2, F3, F4, or F5, Qedit moves to a new location within the file. When you enter any command, Qedit stops the listing, returns to Command mode, and executes the command. When you are on an HP terminal, ListJ enhances and erases the line with the “what to do next?” prompt.

You can combine ListJ with the $include option to browse through the specified files as well as their $include files. You can combine with ListJ with “Q” to display the lines without sequence numbers. Also, you can combine “ListJ” with “T” to print a column template at the top of each screen. In fact, you can combine all three options into “ListJQT” to List-Jump without line numbers, but with a column template.

The screensize can be changed from 23 lines to another number with Set List LJ nn (where nn is some number of lines from 5 to 100). If you put the command Set List QJ On in your Qeditmgr file, you can avoid seeing sequence numbers when you browse.

When List-Jumping reaches the last line of your file, it prints “End! Are you DONE? [yes]” and waits for your answer. “Yes” ends the listing, and “No” starts listing again from the beginning. Set List Endstop On disables this question; List-Jumping just prints the last line of the file and ends the LJ command.

Controlling Printer Listings

When you put “$lp” (or “$lpa” or “$lpb”) in a List command, Qedit opens a file named “LP” (or “LPA” or “LPB”) with the device Class “LP.” The lines that would have been printed on the terminal are written to the printer file instead. At the end of the command, Qedit closes the file, which releases it for printing.

The default Qedit listing to the printer is a raw dump of your lines, with or without line numbers. It has no page breaks, no headings, no title, and no page numbers. However, you can override this default with the Set List command.

Listing to Attached Printer

To list to a printer that is attached to your terminal, use List $record. If you want all listings to $lp to go to the attached printer, do Set List Record On and then List $lp. Qedit will use Record mode on your terminal or PC to print on the attached printer. This option opens a file named LPCRT instead of LP.

If you have a LaserJet connected to your PC and are using Reflection, you will want to Set Printer-Passthru-Conv No in Reflection. Otherwise you will find that some characters are printing oddly, such as the square block printing as a plus-minus sign. If you are using Reflection for Windows, the above option may be called “Disable Printer Translation” or “Use Host Character Set.” As well, you have to select “Bypass Windows Printing” and disable “Auto Form Feed.”

You can combine this option with other listing options such as $PCL or $duplex. You cannot interrupt Record mode with Control-Y, but you can do a soft Reset. This unlocks the keyboard and causes the rest of the output to appear on the screen. You can then stop it with Control-Y.

LP Listings with Headings

To have Qedit do a page break every 60 lines and put a heading with a page number on each page, do List $page On $lp (or $record, $lpa, $lpb). To configure “paging” as the default, do Set List Page On. Two lines at the top of each page are used as a heading. The first line contains the page number, the file name (or the last Text file name in the case of Qeditscr), and the time of the listing, and the second line is blank.

In this mode, Qedit also looks for $title, $page, #pragma page, and #pragma title commands in your file and uses them to create page breaks. The optional string parameter of these commands replaces the date and time in the page heading (e.g., $page “Monthly Staff Review”). A $page or $title command without a string clears the title area of the heading. The only exception to this processing is an LQ of a CCTL file; in this case,
the carriage control in column one of the file determines the format of the printer listing, and $page commands are ignored.

To vary the number of lines per page, do List $lines nn, or use Set List Lines nn for a permanent override, where nn is a value between 1 and 256. (Assumes Set List Page On.).

  /set list page on lines 59  

To print the heading only on the first page, use $lines 0. This causes continuous printing with no page ejects.

  /list $lp $lines 0 all     {ignores $page too}  

To perform continuous printing with no automatic page ejects but skip to a new page on $Page directives, use $lines 999.

  /list $lp $lines 999 all     {skips to a new page on $page only}  

To drop the file name from the page heading, do Set List Name Off. (Assumes Set List Page On.)

  /set list page on name off  

To drop the page numbers from each page, do Set List Num Off. (Assumes Set List Page On.)

  /set list page on name off num off  

To drop the title from the heading, do Set List Title Off. (Assumes Set List Page On.)

  /set list page on title off  

To drop the two-line heading from each page while still doing page breaks, use Set List to disable the three components of the heading:

  /set list page on name off num off title off  

Getting an Even or Odd Number of Pages

There are times when the number of printed pages is important. For example, you could have a printer that is always loaded with pre-printed forms that come in pairs (e.g., Page 1 of 2 and Page 2 of 2) or the paper is folded in certain ways so that a report is easier to tear up and insert into a binder. In both examples, sending a report with an odd number of pages would cause the next output to be on a wrong page.

To prevent this from happening, you can now use the $even or $odd options on the List command and ask Qedit to “round up” the number of pages. The $even option ensures that the output has an even number of pages. Similarly, the $odd option ensures there is an odd number of pages by sending an extra page eject sequence before closing the output file.

These even and odd options are mutually exclusive (i.e., they cannot be both enabled at the same time). If you try use them both on the same command, Qedit uses the last one in the sequence. For example, you can type

  /List $even $odd $lpa myfile  

Qedit does not see this as an error and uses the $odd option, ignoring $even.

These options only make sense if you are sending the list to a printer, either attached or spooled. They have no effect when listing the file to the screen. For this reason, you have to specify a destination printer using $lp, $lpa, $lpb, $record or $device.

You can also use one of these options as the default by using the Set List command. Specifying a $-option on the List command overrides the Set value. There is currently no way to completely ignore the Set options. If you want both options to be disabled, you have to issue

  /Set List Even Off Odd Off  

prior to the List command.

Double-Spaced Listings

When listing to LP, you can force the result to be double spaced with List $double. This feature can be combined with most of the other features of List, including LT, LQ, and Set List Page On. To make all printer listings double spaced, do Set List Dbl On. LQ on a CCTL file disables the Double option because the CCTL codes in the file control the spacing on the listing.

LaserJet Listings

Qedit has two special options for HP LaserJets: $duplex and $PCL. Duplex means double-sided printing, and PCL means Printer Command Language, which is used to select fonts, spacing, and orientation.

$Duplex for Two-Sided Printing. Some LaserJets can print on both sides of the paper; use List $duplex to enable this option.

  /list $lp $duplex all  

PCL = Printer Command Language. All LaserJets have several sizes of character fonts and can print in either landscape or portrait orientation. To help you take advantage of these features, Qedit has a number of PCL codes that can do all the work for you. PCL stands for Printer Command Language, which is the HP standard for printers. To specify a LaserJet option for a single listing, use List $PCL; to configure all listings, use Set List PCL. To disable the special PCL option, use PCL 0. Get a quick on-line listing of the PCL options with

  /hq set,list  

Changing Fonts and Orientation

Landscape-Tiny: PCL 1. To list to the LaserJet in the tiny font that prints across the paper sideways (i.e., 16.67 pitch, landscape), use PCL 1. The number of columns is automatically increased; you do not need to do any special Rec= on your :File command.

  /:file lp;dev=serialp  /list $lp $pcl 1 all  

Landscape-Regular: PCL 2. To list with the regular Courier font in landscape orientation, use PCL 2. Again, there is no need to specify Rec=.

The Standard: PCL 3. The normal default for LaserJet output is portrait orientation (across the narrow side) with the Courier font. However, once you insert a font cartridge into your LaserJet, it may select one of the cartridge fonts as the default instead of Courier. PCL 3 allows you to select the standard Courier font, even if another font cartridge is installed.

Portrait-Tiny: PCL 4. Some LaserJets provide the tiny “Line printer” font in portrait orientation as well as landscape orientation. PCL 4 selects this option.

A4 Special: PCL 5. To print 80 columns, instead of 77, across A4 paper using the standard Courier typeface, try PCL 5. This tightens the spacing between characters.

Legal-Landscape-Tiny: PCL 6. To print tiny letters in landscape orientation on legal-size paper, use PCL 6.

You can combine PCL 1, 2, 3, 4, 5, and 6 with Page On and Off, with Lines 0, with LQ, with $DBL, with $record, and with $duplex.

Two-Column Listings

If your LaserJet supports “Line printer” font in landscape orientation, you can print listings across the page with two columns of text side by side.

  /list $lp $pcl 10 all  {two-column listing format}  /lq $rec $pcl 10 1/200  

If you have a legal-size paper tray, you can use PCL 11 to print two wide columns of 110 characters each on a single piece of paper.

A4-Size Paper

Most of the PCL options, with the exception of PCL 5, were designed and tested with North American letter-size paper. PCL 5 is especially for A4 paper; it reduces the horizontal spacing between characters so that 80 columns of Courier output can fit on a single line. In addition, if you add 2000 to a PCL code, Qedit adjusts the number of rows and columns for that option to match A4 paper. For example, to print two-up landscape on A4 paper, use PCL 2010 instead of PCL 10.

In general, selecting A4 paper gives you more space along the long dimension of the paper and less space along the short dimension. If you are happy with the way letter-size rows and columns work on A4 paper, simply do not add 2000 to the PCL code. If for some reason you want more columns than provided by Qedit (perhaps you are using a PCL-compatible system printer with wider paper), you can override the size by using a :File command with the Rec= parameter, as in :file lp;dev=syslp;rec=-220.

Summary of Qedit PCL Codes

PCL L/P Font A4 Rows A4 Columns Letter Rows Letter Columns Notes
1 L lp 58 188 60 175  
2 L courier 43 110 45 100  
3 P courier 64 77 60 80 “standard”
4 P lp 85 128 80 132  
5 P courier 64 80 60 80 A4-squeeze
6 L lp 60 223 60 223 legal-size*
10 L lp 58 95 60 87 two columns
11 L lp 60 110 60 110 2-up legal*

L/P mean landscape or portrait orientation.

* Note: PCL 6 and 11 were designed to print on North American legal-size paper and will select that size. However, you can see what happens with A4 paper by using 2006 and 2011. Some people have found this useful.

Roman-8 vs. ASCII

The PCL option requests a Roman-8 character set, but some combination font cartridges only supply the ASCII character set (half as many characters means twice as many fonts in a single cartridge). If you ask for landscape Line printer and get landscape Courier instead, your Line printer font probably has the ASCII character set instead of the Roman-8 character set. To request an ASCII font, add 1,000 to the PCL code. For example, if you have a Super Cartridge (55 fonts in one!), use PCL 1001, 1004, 1006, 1010 and 1011. To select both ASCII and A4 paper, add 3000.

Multiple Copies

To produce multiple copies of a listing to a spooled printer, use a :File command. For example, use these commands to produce three copies:

  /:file lp;dev=lp,,3  /list $lp all  

The :File command remains in effect until you enter another :File command or :Reset LP or :BYE.

Redirecting Output to Disc

You can also use :File commands to direct output to a disc file:

  /:file lpb = discfile, old; dev = disc  /:build discfile; rec=-80,16,f,ascii  /list $lpb 100/200  

List Command [L]