Text file manipulation

Enter or retrieve a text file

           +--------------------------------------------------+
           |CALL  CDTEXT (LUN,CHFILE,CHPATH,LBANK*,CHOPT,IRC*) |
           +--------------------------------------------------+
                                  

LUN
Fortran logical unit on which the file should be read or written
CHFILE
Character variable giving the file name
CHPATH
Character string specifying the path name
LBANK
Address of data bank (option R)
CHOPT
Character string with any of the following characters
'A'
File on unit LUN is already open
'R'
Read the text file from disk and convert to a bank at LBANK
'P'
Print the text from the bank at LBANK
'W'
Write the text from the bank at LBANK to the file CHFILE
IRC
Integer return code
0
Normal completion
66
Illegal logical unit number
67
Array too long; no space in buffer

Subroutine CDTEXT can be used to read a text file from disk and convert it into a bank for insertion into the database with CDSTOR, or to write a file from information in an existing bank. Alternatively, the information from the bank may be printed in character format.

Copy character data to or from a bank

       +----------------------------------------------------------+
       | CALL  CDCHAR (CHTEXT,NTEXT,LTEXT,CHPATH,LBANK,CHOPT,IRC*) |
       +----------------------------------------------------------+
                                  

CHTEXT
Character array of length NTEXT in which the text is written (option R)
NTEXT
Length of array CHTEXT
LTEXT
Maximum number of characters per element of CHTEXT
CHPATH
Character string specifying the path name
LBANK
Address of Keys bank KYDB (with option C)
CHOPT
Character string with any of the following characters
'R'
Read the text file from disk and convert to a bank at LBANK
'P'
Print the text from the bank at LBANK
'W'
Write the text from the bank at LBANK to the file CHFILE
IRC
Integer return code
0
Normal completion
61
Too many keys
66
Illegal logical unit number
67
File too long; no space in buffer

Subroutine CDCHAR is functionally similar to CDTEXT, but reads or writes the text from the array CHTEXT.