Print sentence and automatic text split

Using PRINT I want to know how to avoid the automatic split of the words:

  • Husband/wife

  • Año (means year)

Hi Javier,

I think you are out of luck for Husband/Wife. No matter how flexible and functional the Natural developers try to make a language statement, there is always something that can’t be handled. Unlike the SEPARATE statement, the PRINT statement doesn’t seem to allow you to provide a list of delimiter characters. So PRINT is always going to treat the "/’ as a delimiter and split the text there when it needs to wrap a word at the end of a line. Anything that’s not a numeric or alpha character will act as a delimiter.

Could you possibly Examine/Replace “Husband/Wife” with “Spouse”? :wink: Otherwise, to keep them together you would have to program your own version of PRINT, building your output line 1 character at a time, or possibly using SEPARATE into an array with only blank as a delimiter, and then COMPRESS the array fields into an output line until hitting a field that would exceed your line size.

As for Año, it seems to me that the accented n should be treated as an alpha character, and not as a delimiter. Maybe using the Spanish Code Page would define all the Spanish accented characters as non-delimiters. Or maybe you can discuss with your Natural administrator or DBA the use of a Natural Profile parameter called SCTAB or the NTSCTAB macro to make Spanish accents non-delimiters.

As the Parameters manual shows,

SCTAB - Scanner Characters

This Natural profile parameter can be used to overwrite the definitions in the scanner character-type table NTSCTAB , which is contained in the configuration module [ NATCONFG ]. SCTAB corresponds to the [ NTSCTAB ] macro in the [Natural parameter module].

Example of SCTAB Parameter

SCTAB=(5E,LOWER,NDELIM,‘ß’,SPECIAL,7B,SPECIAL,‘Ä’,UPPER,NDELIM)

Examples of NTSCTAB Macro

     NTSCTAB  5E,LOWER,NDELIM
     NTSCTAB  'ß',SPECIAL
     NTSCTAB  7B,SPECIAL
     NTSCTAB  'Ä',UPPER,NDELIM

This example shows the definition of ‘Ä’ with attributes Upper Case and Non-delimiter. You might also be able to redefine a “/” as a Non-delimiter this way, but this being a pretty global change for the duration of your session or job, I’m not sure what other statements and processes would be affected. Anything that expects a “/” to be a delimiter by default would be a problem then.

Good luck,
George

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.