── TYPE ─┬─────────────┬─┬──────┬─<type>───────────────────────────────┤ └─<file name>─┘ └─ TO ─┘
Explanation
The TYPE command changes the FILEKIND attribute of the specified file. If no <file name> is specified, the work file is assumed. In this case, the CANDE command updates the work file if necessary before changing the type. The <type> can be any of the names specified in Basic Constructs under the heading <type>.
If a <file name> is used, it must not contain a usercode or an asterisk (*) prefix.
If the location or length of the sequence number field differs between the old file type and the new file type, CANDE considers them incompatible (unless the new file type is DATA or CDATA).
CANDE allows files other than work files to be changed to an incompatible type. However, warning messages are issued.
CANDE allows you to change the work file to an incompatible type as long as you do not attempt to modify the file. Once the work file has been modified, CANDE must update it when a TYPE command is entered. Therefore, you should not attempt to modify a work file following a change to an incompatible type until you are certain that it contains valid sequence numbers in the correct location.
The LIST command can be used to verify that a file actually contains valid sequence numbers in the sequence field.
Note that CANDE might not allow further manipulation of an altered work file that has been changed to an incompatible type. If this occurs, a solution might be to resequence the file with the OVERRIDE option. However, this might result in lost data, depending on the location and/or length of the sequence number field for the new file type.
If the record size of the work file is not equal to the default record size for the new file type specified in the TYPE command, then the TYPE command is accepted, and the file type of the work file is changed to the default file type. However, a warning message is issued.
Refer toRecord Formats for the default record length value and minimum record length value for the supported file types.
If the sequence field of the work file is not equal to the sequence field of the file type requested in the TYPE command, the following warning message is issued:
# WARNING: ACTUAL RECORD SIZE (14 WORDS) IS LESS THAN THE DEFAULT (15 WORDS) FOR TYPE ALGOL
If the record size of the work file is less than the minimum record size for the file type specified in the TYPE command, then the TYPE command is not accepted, and the following warning message is issued:
#WARNING: ACTUAL RECORD SIZE (15 WORDS) IS GREATER THAN THE DEFAULT (14 WORDS) FOR TYPE COBOL85
If the sequence field of the file type requested in the TYPE command is more than eight characters, as is the case for the WIDE type, then the TYPE command is not accepted, and the following message is displayed:
#CANNOT CHANGE WORKFILE TYPE TO <type>.
Examples
type algol # WHAT #WORKFILE WOOF: ALGOL (PREVIOUSLY FORTRAN) TYPE DATAFILE COBOL # ty fortran/file seq # MAKE SHORT SEQ #WORKFILE SHORT: SEQ 100abc 200def TYPE ALGOL #UPDATING # WARNING: ACTUAL RECORD SIZE (14 WORDS) IS LESS THAN THE DEFAULT (15 WORDS) FOR TYPE ALGOL # LIST 100 abc 200 def # TYPE COBOL # WARNING: ORIGINAL SEQUENCE FIELD (FOR TYPE SEQ) WAS COLUMNS 73-80; TYPE COBOL EXPECTS SEQUENCE NUMBERS IN COLUMNS 1-6 # LIST #NON-DIGIT IN SEQ (1-6) "abc ": 00000100 #FILE:(UZER)CANDE/SHORT ON USERPACK # TYPE CSEQ # WARNING: ORIGINAL SEQUENCE FIELD (FOR TYPE SEQ) WAS COLUMNS 73-80; TYPE CSEQ EXPECTS SEQUENCE NUMBERS IN COLUMNS 1-5 # LIST #NON-DIGIT IN SEQ (1-5) "abc ": 00000100 #FILE:(UZER)SHORT ON USERPACK # TYPE ALGOL # WARNING: ACTUAL RECORD SIZE (14 WORDS) IS LESS THAN THE DEFAULT (15 WORDS) FOR TYPE ALGOL #