Text Command [T]
Copies a file into Qedit, retaining line numbers, file attributes, and optionally, user labels. Also works on spool files and Copylib members. Use Text to convert a file into Qedit format or to make a copy of an existing file. After a Text, the new copy is “open” and ready to edit or browse.
TEXTfilename [,type] [,clearoption]
filename [,SAVETABS] [,clearoption]
filename [,BROWSE] [,clearoption]
filename [,NEW] [,clearoption]
filename [,SETINCR] [,clearoption]
filename [,LABELS] [,clearoption]
workfile [,workformat] [ (size) ] = filename [,type]
(Q=unnumbered)
(J=extra scr file, same as ,NEW)
(Defaults: size = 50% bigger)
If you do not specify a workfile, Qedit checks to see if you have a workfile Open and it is empty. If it is, Qedit will Text filename into it. If not, Text uses the primary scratch file named Qeditscr in your logon group. If you do Text xx,New or TextJ, Qedit creates an extra scratch file to receive the copied file. You can have up to eight extra scratch files (as well as the primary scratch file) and switch among them with Open ?.
Use filename,type to override the attributes that Qedit assigns to your file. Use workfile,workformat to override the attributes assigned to the workfile. See below for details.
The Text command works on any file that you can read, but it truncates records longer than 8,172 columns and prints a warning. You can use Qedit to edit program files.
The Text filename,Browse command copies a file into Qedit, but it won’t let you modify the file. You can use the List command, including List-Jumping, Hold, Visual mode HH and ZZ, and any other Qedit functions that do not modify the file. There are two advantages to Browse mode: it protects you from making unplanned changes to a file, and it does not update the Mod-Date of the file.
An asterisk (*) as filename means the workfile most recently shut. Text * is useful when you want to expand a workfile that is full; use Shut * to rename the new workfile to the old name.
If you do specify a workfile name, Qedit shuts your current workfile and creates a new workfile to hold a copy of filename.
If you try to Keep the file with its original name i.e. you enter a Keep without a filename, you will get an error.
/Text txtfile,browse /K File opened with Browse, please specify a Keep file name
You can still force a Keep by specifying an explicit filename as in:
/Text txtfile,browse /Keep txtfile TXTFILE.DATA.ACCT,OLD 80B FA # of records=16 Purge existing file [no]? y
The size will be 50% larger, unless you specify an explicit size for the number of lines for the file to hold (from 200 to a maximum of 99,999,999).
Use the clearoption to explicitly specify what Qedit should do when the modified content of the workfile is about to be overwritten. Enter Yes to confirm it is OK to clear the workfile. Enter No to prevent the overwrite. See “Clearing the Workfile” below.
See Set Work for details on calculating nominal size versus real size, as well as options that control treatment of user labels, Qeditscr and non-empty workfiles.
Examples
Copy in a sample job, modify, and :stream: /text jobfile {copy Jobfile into Qeditscr} /mod "XXX" {make changes to template job} /:stream * {launch job into MPE batch queue}
Make copy of source file, start new version:
/text hwsy.src {copy Hwsy.Src into Qeditscr} /shut hwsy.bob {save as permanent file} /open * {open Hwsy.Bob and edit it}
Copy a source file without using a scratch file:
/text audit.bob = audit.source
Use Text and Keep to revise a schema file:
/text schema {copy Schema into Qeditscr} /mod 5/10 {make some changes} /keep {update master copy of schema} SCHEMA.BOB.GREEN,OLD 80B FA # of records=86 Purge existing file [no]? yes
Text two files and copy lines between them:
/text One {copy One into primary scratch} /text Two,New {copy Two into extra scratch} /hold 10/20 {or use HH in Visual mode} /open * {switch back to file One} /add 100=hold {or use AH in Visual mode} /keep {save changes to One}
Text a data file with its user labels:
/text quizsub.data,labels
Expand a Qedit workfile when it is full:
/shut /text filename /shut filename /open *
Absolute File Name
When you Text a file, Qedit remembers the absolute path name of the file, not the relative name. This becomes the default for the Keep command. If you Keep with an explicit name, Qedit remembers the absolute path of that name. If you do Set Keep Name xxx to override the default Keep name, Qedit remembers xxx as a relative name, not as an absolute name. This gives you all the options you need to take advantage of the POSIX namespace and Change Directory (Chdir) command in MPE/iX 5.0.
Native-Mode Spool Files
Qedit can Text output spool files on MPE/iX, but does not Keep them (use List LP instead).
/showout /text #o1234 /text #9876
COBOL Copylib Members
To edit a Copylib member with Qedit, you Text it in like an ordinary file and Keep it with your changes. The member name goes in parentheses and the name of the Copylib file goes after that (the file name may be omitted if you have a :File command for “copylib”).
/file copylib=copylib.pub.develop /text (custrec) /text (custrec) copylib.test.develop
How to Text Several Files?
Qedit has a primary scratch file that is referred to as “Qeditscr”. Any time you take the default options for Opening or Texting a file, your work will be in the Qeditscr primary scratch file.
What if you want to edit two or more files and copy lines between them? You could Text the first file, Hold the desired lines, Keep your changes, then Text the second file and insert the lines. However, if you are doing a large number of edits, the constant Text and Keep operations are inconvenient.
A faster method is to Text each file into an extra scratch file of its own. Then use the Open ? or Open *-n command to switch quickly among them. By default Text always copies the file into the primary Qeditscr scratch file. However, Qedit can supply up to eight extra scratch files. Use the New option (text abcdef,new) or do Text-J (textj abcdef).
The New command can also create extra scratch files. Warning: If you do New;Text file,New you will create two Extra Scratch Files, not one.
Saving Your Work
When you Exit, Qedit checks whether you have any unsaved edits in any of your Extra scratch files. If so, you are prompted to Discard? them, or stay in Qedit to save them. Qedit also asks you to Discard your changes if you Close a scratch file, which removes it from the Open-Stack and purges the file.
Clearing the Workfile
Sometimes Qedit will ask you if it is okay to clear the existing contents of the scratch file and sometimes it won’t. If you have not made any changes to the scratch file since you last did a Text or Keep, or :Stream *, Qedit assumes that you have an
other copy of the lines and it is okay to delete the copy in the scratch file.
In batch, the answer to the “Clear?” question will always be “yes”. If you know the answer you want, you can append it to the file name parameter just as you do in the Keep command:
/text abc,yes /text def,no
Using Set Keep for File Attributes
When you Text a file, Qedit remembers as many attributes of the file as possible. When you later Keep the file, Qedit attempts to reproduce the original file. The Text command does an implicit Set Keep command to record what it has discovered about the Text file. You can use Verify Keep to see whether the Text file had sequence numbers, was permanent or temporary, etc., and then use Set Keep to override any of those attributes.
Using TextQ for Numeric Data Files
TextQ means “text quiet” or “text unnumbered” and is the same as using ,UNN after the filename. Use TextQ to edit any data file that may contain numeric digits in the last eight columns. Otherwise, Qedit may interpret those digits as sequence numbers, if the first five records of the file contain data that looks like ascending sequence numbers.
Treatment of Sequence Numbers
Qedit retains whatever sequence numbers it finds in the external file. If Qedit finds an invalid number, it begins assigning new numbers starting from the last valid number and adding Increment.
If the file does not have sequence numbers, Qedit assigns new ones, starting at 1.0 and going up by a calculated increment. The calculated increment is based on the file’s current characteristics such as the number of records.
This works well in the majority of cases. However, there are cases where the calculated increment is not accurate enough or the user wishes to have a specific increment. This can be done by setting the increment with the Set Increment command. Then, use the Setincr option on the Text command.
/Text bigfile {Use calculated increment} /Set Increment .02 {Set the increment value} /Text bigfile,Setincr {Override the calculated increment}
Files with User Labels
By default, Text discards the user labels of the external file. However, if you specify Text file,Labels, Qedit attempts to copy user labels into your workfile, so that it can write them out again when you do a Keep. This is handy if you are editing a Cognos sub-file. If you do Text file2=file1,Labels, Qedit can make room for up to 252 user labels. If you Text into an existing workfile, there may not be enough room in it for all of the user labels.
To make Text,Labels the default, use Set Work Labels ON.
Files with Header Records
Text has an option to skip 1 to 9 records before deciding the “language” of the external file. The format is as follows:
TEXT lines/filename
where lines is the number of lines to skip over.
This is useful with source files from external sources, such as IBM machines, that may have control cards without sequence numbers, followed by a numbered COBOL source program. By skipping the control cards, Qedit may recognize the file as a COBOL program, instead of a Job file.
Tab Character
By default, Qedit retains tab characters in a file when it Texts the file. However, another option is to expand the tab characters into spaces (to the next tab as established by Set Tabs Stop). You can expand tabs on a specific file by using the Expandtabs option on the Text (or List or Add-File) command. To force all file accesses to expand tabs, do Set Expandtabs On (the default is Off). With Set Expandtabs On, use the Savetabs option to access a file without expanding tabs into spaces:
/text srcfile,expandtabs /set expandtabs on /text dbfile,savetabs {override Set Expandtabs On}
If you are editing files with tab characters, see Set Vis Tab.
Overriding Qedit’s File Type
Sometimes Qedit will interpret the format of the external file incorrectly. For example, if you have COBOL source code from an IBM system, it will probably not have a 1052 file code. Thus, Qedit will treat it as a JOB file. You can override the file type that Qedit would assign by appending a file type keyword to the file name:
filename,COBOL | |
filename,FTN | or FORTRAN |
filename,SPL | |
filename,PASCAL | |
filename,JOB | |
filename,RPG | |
filename,TEXT | |
filename,COBFREE | |
filename,DATA | forces Jumbo workfile |
filename,UNNUMBERED | |
filename,HTML | |
filename,XML | |
filename,QSL | |
filename,JAVA |
The keyword may be shortened to any leading substring, but the comma is required. You cannot use this option to force Qedit to warp a file into something that it is not. You can only use it to resolve ambiguities (i.e., between FORTRAN, Pascal, and SPL, which look the same).
/text funny {this should be a COBOL file} Language is now JOB {but it has a file code of 0} 678 lines in file /text funny,cobol Language is now COBX 678 lines in file
Overriding the Workfile Format
You can override the workfile format that Qedit would use by appending a workfile format keyword to the workfile name:
workfile,DATA {forces Jumbo workfile}
workfile,WIDE {forces Wide-Jumbo workfile}
The keyword may be shortened to any leading substring, but the comma is required. If you don’t specify a keyword, Qedit will use the format that is most appropriate for the file you are texting in. If the lines have 256 characters or less, Qedit creates a regular workfile. If the lines are between 257 and 1,000 characters, Qedit creates a Jumbo workfile. If the lines are wider than 1,000 characters, Qedit creates a Wide-Jumbo workfile.
You can force Qedit to use a wider format by using the Data or Wide keywords to override Qedit’s choice. If you want the Jumbo format, use the Data option. If you want the Wide-Jumbo format, use the Wide option.
You cannot force Qedit to use a smaller workfile format.
Let’s assume that we have a file called Funny, which has 80-character lines.
/text funny {this would create a regular workfile} Language is now JOB 678 lines in file /v open Open: QED35753.SRC.DEVACCT,Scratch JOB Length:80 Margins:1/80 /text wrkdata,DATA=funny {this creates a Jumbo workfile} Language is now JOB 678 lines in file /v open Open: WRKDATA.SRC.DEVACCT JOB Jumbo Length:80 Margins:1/80 /text wrkwide,WIDE=funny {this creates a Wide-Jumbo workfile} Language is now JOB 678 lines in file /v open Open: WRKWIDE.SRC.DEVACCT JOB W-jumbo Length:80 Margins:1/80
These examples require that you name the workfiles and make them permanent. If you want to have a scratchfile while making it a Jumbo workfile, you should
/Set Lang Data /Set Length 1000 /AQ 1=funny
If you want to make a Wide-Jumbo scratch file, set the Length to a value larger than 1,000. Note that the Language remains Data.
CCTL Disc Files
When you text in a disc file that was created with the CCTL attribute, the first column of each line contains a “carriage control” code. For example, “1″ means page eject and “+” means overprint. There are two codes for single space: ” ” (i.e., blank) and binary zero (i.e., the null character). Unfortunately, binary zero is nonprinting, so when you List a line the rest of the columns are shifted over one space. Also, if you use Visual to edit such a file, the Binary Zero in column one is printed as a dot and you cannot edit the line. To avoid these problems, Qedit replaces the Binary Zero in column one with a Space character, which means the same thing.
File Modification Timestamp
When you use the Text command on a file, Qedit stores the file’s modification timestamp in the workfile. You can display the timestamp by using the Verify command. Qedit uses the stored timestamp to perform some verification if you try to either Keep the file or Shut and re-open the workfile.
$File Keyword
File names containing special characters might cause problems to Qedit. For example,
/Text ./file:name Error: Extra or invalid character in Text command
If you run into this problem, you can use the $file keyword instead. The $file keyword can be used wherever a file name is expected, such as in Text, Add, List. The syntax is:
$file[=]"filename"
$File is a reserved keyword, which is followed by an optional equal sign and the actual file name enclosed in string delimiters. Without doing anything to the string, Qedit tries to open the specified file. The previous example now becomes:
/Text $file="./file:name" 10 lines in file
In this example, the file name is assumed to be in the POSIX namespace. If you want to access files in the MPE namespace, you now have to enter the name in uppercase and use the POSIX notation:
/ACCOUNT/GROUP/FILENAME