Print. DORIC 9.65, INFO-Text software
Advertisement
Advertisement
PRI
NT [beg_rec_1,end_rec_1& beg_rec_2...] syntax cont’d
DF_item system_item system_variable string
#
T
#
X
*TAB
[#] [,...]
*X
[#]
*L
[#]
*W
[#]
*E
JECT
*A
row,column
*C
#
*CONT
EXT
*T
EXT syntax cont’d
[
,=
] [
NOLINE
CONT
EXT
T
EXT]
or
PRI
NT
=
sends to your spool file or current output file any combination of data file items, system items, system variables and literals. An unqualified PRINT command prints all item values for all selected records with each record printing on a new line.
arguments
[beg_rec_1,end_rec_1& beg_rec_2...] you can print ranges of records by specifying the beginning and ending record numbers. beg_rec_# and end_rec_# must be numeric literals.
DF_item an INFO data file item.
system_item an INFO system item.
INFO Reference Manual Commands 395
system_variable an INFO system variable.
string a character string enclosed with single quotes.
*TAB# or
#T specifies the column at which to position the next print item where # is the number of the column (1-
200, depending on the value of $PRINTER-SIZE; note that whatever you put in column 1 is treated as a carriage control character and does not print) unless you specify
'No Fortran' option. An unqualified *TAB positions the next print item seven spaces to the right of the current column. If you use #T, you must include the tab column value. The examples below print the LAST-NAME from records 1-3 and records 9-12, starting in column 25.
ENTER COMMAND >PRINT 1,3&9,12 *TAB25,LAST-NAME
or
ENTER COMMAND >PRINT 1,3&9,12 25T,LAST-NAME
*X# or #X specifies the spaces to insert before the next print item where # is the number of spaces (1-200, depending on the value of $PRINTER-SIZE). An unqualified *X inserts five spaces. If you use #X, you must include the space count value. The examples below print the LAST-NAME, 15 spaces, and then the DEPT for every record selected.
ENTER COMMAND >PRINT LAST-NAME,*X15,DEPT
or
ENTER COMMAND >PRINT LAST-NAME,15X,DEPT
*L# inserts the number of line feeds specified by n. The line count defaults to 1. To double-space, specify *L2.
The following example prints the LAST-NAME from the first 10 records using triple spacing:
ENTER COMMAND >PRINT 1,10 *L3,LAST-NAME
396 Commands INFO Reference Manual
*W# specifies the print width for the next print item. If the item is a character item and the # specified is less than the item's defined output width, INFO truncates the item value to the specified number of characters. If the item is numeric and the # is less than the item's defined output width, INFO prints blanks for the item. The following example prints the LAST-NAME from the first 10 records, using one character as the display width. As a result, only the first letter of each name will appear in a column.
ENTER COMMAND >PRINT 1,10 *W1,LAST-NAME
*EJECT performs a page break before the next print item.
The following command starts a new page before each
LAST-NAME value is printed for the first five records. As a result, you will have five screens of output with a single
LAST-NAME printed at the top of each screen.
ENTER COMMAND >PRINT 1,5 *E,LAST-NAME
*Arow,column takes the number of the row specified and prints the next print item that many rows below the last row printed and in the specified column. The example below prints LAST-NAME from the first selected record at row 5, column 10 and LAST-NAME from the second selected record at row 10, column 10.
ENTER COMMAND >PRINT 1,2 *A5,10,LAST-NAME
*C# prints a C-type data file item in a column where # specifies the width of the column. If # is less than the defined output width for the item, INFO truncates the item to # characters and wraps the remaining characters in the item to the next line of the same column. Each line of the column conforms to the # width specification. The example below prints the first three characters of LAST-
NAME on one line, prints the next three characters on the next line directly below the first three characters, and so on, until the number of characters defined in the output width is used up.
ENTER COMMAND >DISPLAY *C3,LAST-NAME
INFO Reference Manual Commands 397
INFO-Text only
INFO-Text only
INFO-Text only
INFO-Text only
*CONTEXT prints the specified or A-item in context, by including with the search text the two lines before and the two lines after the search text.
CONTEXT prints all A-items referenced in the command line in context, by including with the search text the two lines before and the two lines after the search text.
*TEXT prints the text portion of the specified A-item.
TEXT prints the text portion of all A-items referenced in the command line.
[,...] any of the previous options may be specified, each preceded by a comma, for a total of 16 specifications.
= an equal sign at the end of a print list prevents INFO from issuing a carriage return after data from each selected record is printed. Instead, INFO continues printing information from the next selected record on the same line, wrapping only at the end of the page width.
Subsequent PRINT commands always reset this effect. It is used most often to save space when printing one or two items. This option is not valid in even program sections.
= (equal sign) used as the only print specification (the second syntax description above) performs a page eject by sending a top-of-form print control character to the spool file.
NOLINE operates like the equal sign (=) when the equal sign is used at the end of a print list. This NOLINE effect does not carry over to subsequent PRINT commands.
This option is not valid in even program sections.
notes
n
By default, the PRINT command places output starting in column 2 to allow for fortran control characters. To force output to start in column 1, use PRINT 1T or PRINT 0X.
n
An unqualified PRINT command prints all item values for all selected records with each record starting on a new line.
398 Commands INFO Reference Manual
n
When printing a range of records, you can separate the beginning record number and end record number with either a comma (,) or a dash (-).
n
There cannot be more than 30 DF_items per PRINT command. The more formatting specifiers you use or the longer the literal in the PRINT command line, the fewer the number of display terms that can be included in the
PRINT command line.
discussion
INFO separates adjacent data file items in the PRINT output with a single space. You can instruct the system to leave more spaces by using either the *X or *TAB options.
Use PRINT = to force a page break in a file to be spooled.
INFO reserves the first print position in each line for a carriage control character. You can include any standard carriage control character in column one by using the
*TAB option followed by the control character.
examples
PRINT *TAB1,'+','_____' underlines the first four positions of the previous print line. (The carriage control character
'+' suppresses line spacing.)
The following sequence prints the value of the item SSN,
10 spaces, and then the value of the item EMPLOYEE-
NAME for each selected record.
ENTER COMMAND >SELECT D.EMP
2 RECORD(S) SELECTED
ENTER COMMAND >PRINT SSN,*X10,EMPLOYEE-NAME
ENTER COMMAND >SPOOL
The following lines appear on your print output:
018670158 JOHN DOE
424889765 BILL SMITH
INFO Reference Manual Commands 399
Download
Advertisement