When it comes to line numbers, Qedit goes by the following rules. If this is a Cobol source file, Qedit expects the line numbers in the first 6 columns of each line. For some other files, it expects line numbers in the last 8 columns of each line. Furthermore, the first 5 lines of the file must contain valid numbers (all numeric digits) and be in ascending order. If one of these requirements is not met, Qedit reports a line number error and does one of 2 things:
abc 12345678 def 23456789 ghj 34567890 :qedit /t myfile 12345.678 abc 23456.789 def 34567.89 ghj /t myfile,unn /l all 1 abc 12345678 2 def 23456789 3 ghj 34567890 /e :print myfile abc def ghj :print myfile;nonum abc 12345678 def 23456789 ghj 34567890
Let's say you have the following Cobol file on HP-UX:
000110*VERSION "Version Robelle 1.1 2003" 000130 IDENTIFICATION DIVISION. 002222 PROGRAM-ID. POPRINT. 000150 ENVIRONMENT DIVISION. 000160 CONFIGURATION SECTION. 000170 SOURCE-COMPUTER. HP3000. 000180 OBJECT-COMPUTER. UNIX. 000280 INPUT-OUTPUT SECTION.Keep in mind that Cobol line numbers have 3 decimal places so the first line is 0.11, not 110. It's also worth noting that the default increment is 0.1. A simple Text will get you the following error:
qux/t cobnonum.pco 'Language' is now COBX Error: line number out of sequence (000150) - renumbering the rest 9050 lines in file qux/listj [ 0.11 *VERSION "Version ECOMETRYRev532:1" 0.13 IDENTIFICATION DIVISION. 2.222 PROGRAM-ID. POPRINT. 2.322 ENVIRONMENT DIVISION. 2.422 CONFIGURATION SECTION. 2.522 SOURCE-COMPUTER. HP3000. 2.622 OBJECT-COMPUTER. UNIX. 2.722 INPUT-OUTPUT SECTION.Notice the original line 0.15
ENVIRONMENT DIVISION.is now 2.322 (last valid line number 2.222 incremented by 0.1). In this case, line 2.222 is likely incorrect and should be fixed. Aside from the new numbers, the file is intact and Qedit has been able to text it all in.
Important: the line number on the out-of-sequence error message has been added in version 5.4.11. Earlier versions do not provide the information making it hard to find which line needs to be fixed.
Now let's say the invalid line number above (2.222) is 999.992 instead. Qedit tries to renumber the remaining lines from that value with an increment of 0.1.
qux/t cobnonum.pco 'Language' is now COBX Error: line number out of sequence (000150) - renumbering the rest Error: Too High 23 lines in file qux/l all 0.11 *VERSION "Version ECOMETRYRev532:1" 0.13 IDENTIFICATION DIVISION. 997.992 PROGRAM-ID. POPRINT. 998.092 ENVIRONMENT DIVISION. 998.192 CONFIGURATION SECTION. 998.292 SOURCE-COMPUTER. HP3000. 998.392 OBJECT-COMPUTER. UNIX. 998.492 INPUT-OUTPUT SECTION. ....Qedit will run out of line numbers very quickly causing the
Error: Too Highmessage. This error is a lot more serious than a simple renumbering. When this error occurs, Qedit stops reading the file. That's why it shows 23 lines in the file instead of the expected 9,050 above. It's very important not to keep the file.
There are a few options when Qedit runs out of line numbers. You can force Qedit to use a specific increment by specifying the Setincr option on the Text command. For example, the following commands forces Qedit to use a .01 increment instead of the default.
/Set Incr .01 /T myfile,setincrIf that does not work, you have to see the numbers. In order to do this, use the Unnumbered option on the Text command. Line numbers now appear as data. Find the invalid line number displayed in the error message (if any). If there are just a few lines to fix, enter valid numbers where needed. If there's a large number of lines to fix, it may be easier to remove them all with a Change command and re-enter a valid sequence in the first 10 lines or so. Keep the file and Text it back in.
Qedit for Windows does not have equivalents for the Set Incr and Renum commands and Setincr option. There is, however, an equivalent for the Unnumbered option. Just enable the Force Unnumbered option on the Open Host File or Directory dialog boxes.
If you do not have host-based Qedit but have the Qedit for Windows server, you should open the file with Force Unnumbered enabled and fix the line numbers.
>" or "
>>") on MPE or HP-UX commands. It could also be done by more complex software such as version control packages. Often times, the offending lines have been imported from foreign systems. Once the root cause has been identified, it is important to document it properly and maybe set internal standards to prevent it in the future.
....Back to the Qedit Q&A Page