I want to supress the line numbers in the source code files. What is the best way to convert the old line number files to source code files with no line numbers?
I was thinking of:
Using Spod to suppress the line numbers.
Using a Skript, which deletes all line numbers.
Is there a better way to do it?
What are the pitfall by suppressing the line numbers?
Hello Markus,
How are you?
.
By default, Natural on Open Systems saves Line Numbers in the source file (eg. myprog.NSP) even when Line Numbers are toggled off in the Natural editor.
The default behaviour may be changed via the FTOUCH utility.
.
Examples:
To suppress the saving of line numbers:
C:\Program Files\Software AG\Natural\6.3\Bin\ftouch.exe lib=mylib suprln=ON
NB. You must then re-SAVE the Natural source(s).
.
To enable the saving of line numbers:
C:\Program Files\Software AG\Natural\6.3\Bin\ftouch.exe lib=mylib suprln=OFF
.
Kind regards,
Peter
That I know, but after changing the mode, the line numbers stays in the old source code files. When I stow a module, then the line numbers are suppressed.
I don’t want to stow all modules to suppresse the line numbers, thats why I’m thinking of a skript to do the job directly in filesystem.
I wouldn’t say one or the other is “better”, they follow different philosophies,
so while SPoD may fit your purposes better than ONE does it may be just
the opposite for others
Just like I tried to explain without success, so I’ll try again
1.) ftouch lib=xyz suprln=ON
2.) CATALL and just change Action from Catalog to Save (or Stow). This will remove the linenumbers as all sources will be re-saved and this wil honor the suprln setting.
I’m not very familiar with Natural on Open systems.
Perhaps the Natural utility Object Handler is an option for you.
You can UNLOAD the Natural sources with the options:
SUBSTITUTE : Replaces line references by labels during the unload in Transfer format.
This option only applies if your source-code line numbers are used for statement references. If so, the line numbers of referenced lines and the line number references are replaced by labels. The sources are not modified in the database.
INCLUDE-LINE-NUMBERS: Transfers line numbers during the unload in Transfer format.
By default, line numbers in Natural objects are not unloaded.
Then LOAD the sources with the Object Handler in a new library with the default of suprln=off like Wolfgang mentioned. (I don’t know whether this works. As said, I’m not familiar with Natural on Open Systems).
Besides the fact that it isn’t required to move the sources at all with the method I described above,
with Natural Studio (or Natural ONE) the easier way (compared to SYSOBJH) would be to simply
drag-and-drop the sources to a different library and back, in combination with the correct SUPRLN setting.
I tried this, but it didn’t work.
All line numbers are suppressed, but all “Metasourcecodedata” is overwritten
L *
Name Type Lib Source User Source Date
NUASSHD Copycode NUNIT Macke 2010-02-09 15:39
NUASSP PDA NUNIT MWESSJOH 2011-09-12 08:19
NUASSP LDA NUNIT MWESSJOH 2011-09-12 08:19
Now I’m the Source Owner. I don’t want to touch this.
By the way, you can see, that this method doesn’t work for copycodes.
To keep the metadata simply copy away FILEDIR.SAG before the CATALL and back afterwards,
but you are right, there’s no way to strip linenumbers from copycodes this way.
There are a number of subroutines in SYSEXT which you can use here, for example USR2019N to
read and SAVE objects (including copycodes), so this should take care of it, but you still will have
to push / pop FILEDIR.SAG to keep the “meta data”.