Suppressing Line numbers

Hello,

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:

  1. Using Spod to suppress the line numbers.
  2. 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?

Regards,
Markus Wessjohann

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:

  1. 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).
    .
  2. 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

Hi,

fine thank you.

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.

Is this OK? Can I touch the files directly?

Best regards,
Markus Wessjohann

A simple CATALL should take care of that.

I would strongly discourage messing with source code outside of Natural.

Best regards,

Wolfgang

Let me guess: you want to feed svn or some other versioning system with your sources …

Why not use NaturalOne?

A download to Eclipse will remove all line numbers and takes care of line number references.

Hi,

@Wolfgang Winter: No, it doesn’t work. You must save the files, but after you saved the file you change the source User ID and the Source Date :-(.

@Matthias: Yes, I want directly commit the source code to svn.

@Weihnachtsbär: SPoD is better than NaturalOne.

The default “Action” for CATALL is “Catalog”, did you try to change this to “Save” or “Stow” ?
“Catalog” will, obviously, not touch the source at all.

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 :wink:

Hi,

I think we are leaving the topic. I will explain it again.
I want

  1. supress all line numbers for new files.
  2. supress all line numbers for old files and leaving the source code metadata in the FILEDIR.SAG.

The reason is, I want to check-in and -out from the fuser-directory direktly to the subversion repositry.

New files is OK, but how can I change the old ones, with unchanging the metadata?

Is this with Natual-Tools possible or should I deleting the line numbers by Shell-Skript?

Best regards,
Markus Wessjohann

Just like I tried to explain without success, so I’ll try again :wink:

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.

For example, I created a new library with the default of suprln=off and then created a small program whose source
on the file system looks like this:

0010WRITE *INIT-ID
0020*
0030END

I then did the ftouch suprln=ON, catall ‘Save’ and it looks like this afterwards:

WRITE *INIT-ID
*
END

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.

Hi,

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.

Best regards,
Markus Wessjohann

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”.

So, to sum it up I’d propose the following:

  • ftouch suprln=on
  • copy away FILEDIR.SAG
  • use USR4206N to read library directory and USR2019N to re-save without line numbers
  • copy back FILEDIR.SAG