Can Natural create output in postscript format?

First off, Natural is completely new to me so target your answers accordingly…

I’ve been put on a team migrating an ADABAS/Natural application off of an Amdahl mainframe onto a IBM/Unix midrange server. I’ve been tasked with printing, and to reduce the multiple-printer configuration issues I thought it would be easier if Natural could output in postscript format (all printers will accept it).

Does anyone know if it is possible?


As far as I know, Natural doesn’t support PostScript directly. I guess you got the following possibilities:

  1. Write postscript-files as Workfiles.
    Advantage: Maybe really interesting.
    Disadvantage: You have to learn the really strange PostScript programming language. And that should be really time consuming.

  2. Use an API.
    But I don’t know, if this is possible for your Natural on UNIX. I guess not. Maybe there is a way to write a converter for the open source tool “GNU Ghostscript”. But that’s just a wild guess.

  3. Use a simpler page description language which is supported by your printers (e.g. PCL, ESC/P) and write your documents directly to a workfile.
    At my former company a NATURAL-programmer solved this problem by using PCL.

Hope this helps!


Postscript is not directly supported by Natural. Natural can only print plain text files. But in this plain text file formatting commands are embedded. If you do the formatting your own (eg. with PRINT (dev) formatting-string) natural will take this as printable data and reposition the print “cursor”. At least, the line number is changed. I don’t think that is, what you want. You have the following possibilities:

  1. In the profile of the printer you can define control-sequences for the different (AD=…). If you, for example define control sequences for (AD=I) to be bold, and in Natural you use PRINT (dev) string (AD=I), Natural surrounds the string with the control sequences for bold and normal for the desired printer. You can also use any control sequence and also postscript printing commands, i think. If it is not possible, you can define your own tags and run a script against the output string to convert the output into postscript .

  2. you can define two virtual printers e.g. 1 and 2 both pointing to the same device or file, e.g. LPT1. In your Natural Session you define your printers like:

define printer(outp=1)
define printer(contr=2)
format (contr) ps=0

you can then write your printing data to report (outp) and control sequences to report(contr). Writing to report (contr) does not influence the line count on report(outp). The disadvantage is you can only write control sequences per line.

The better case is case 1 as it does not influence program logic and you can change the underlying shell script that does the formatting for you! You can also mix both. Once at another site we used this technique to write a report header containing output destination, recipient and so on and the script read this and routed the output to the desired printer.

Thanks for the suggestions.

I kind of doubted it would have postscript support, but had to make sure before I searched for another solution.

I suspect I will end up writing a script to massage the output, then pass it though a text-to-postscript translator, with the output being as close as possible as to what gets produced now. The end-users don’t want any big changes.