Natural and Printing

[i] :roll:
Grand Day,

I’m using Nat 61105 on Linux/390
I use NATPARM to change LPT1 device to be the lp command
I run a Natural program that writes to this device
I get a ‘hang’ in the Natural task

What should I do to get some output and not a ‘well hung machine’ ?
[/i]

Hello Frage,

The way I print on Unix is as follows :-

In NATPARM define the printer as, for example, /export/home/user/print

and create a script file called print :-

#!/bin/sh
cat > /export/home/user/file
lp file
exit 0

I am sure there are alternate ways of doing this, but I used this from early Natural 2 days and this has always worked since then.

I have checked using just lp in NATPARM and that works too on my machine

Peter

Hello PeterDowson!

In my NATPARM, I can find the following settings


---------------------- Device Parameter Assignments ----------------------
Logical  Line Page Max                                                    
Device   Size Size Page  Physical Device / Print to File? (Y/N)           
-------- ---- ---- ----- -------------------------------------------------
VIDEO      80   24 32767 VIDEO                                           N
LPT1       80   66 32767 LPT1                                            N
LPT2       80   66 32767 LPT1                                            N

and …


------- Report Assignments ------
                Close         
Report Device   Mode   Profile
 0     VIDEO    Auto          
 1     LPT1     Auto          
 2     LPT1     Auto          

A script (similar to your one) is /sag/bin/LPT1.

My question: Where did you enter your path to your script? I thougt the print-scripts have to be in /sag/bin…

Hello Matthias,

this is a bit of my NATPARM module :-

±---------------------- Device Parameter Assignments ------------------------+
| Logical Line Page Max |
| Device Size Size Page Physical Device / Print to File? (Y/N) |
| -------- ---- ---- ----- ------------------------------------------------- |
| VIDEO 80 24 32767 VIDEO N |
| LPT1 80 66 32767 LPT1 N |
| LPT2 80 66 32767 LPT1 N |
| LPT3 80 66 32767 LPT1 N |
| LPT4 80 66 32767 lp N |
| LPT5 80 66 32767 awk {“/export/home/pad/pad001”} N |
| LPT6 80 66 32767 /export/home/pad/padprt N |
| LPT7 80 66 32767 LPT1 N |
| LPT8 80 66 32767 LPT1 N |
| LPT9 80 66 32767 LPT1 N |
| LPT10 80 66 32767 LPT1 N |
| LPT11 80 66 32767 LPT1 N |
±----------------------------------------------------------------------------+

Hope that makes sense - note that all the setting may not work - I play with different options occasionally :wink:

LPT6 is a good option. I am not sure if I would call the program LPT1 though - give it an independant name.

Peter

Is this working? So we even don’t need a script… :smiley:

Setting the printer to ‘lp’ will work on our system. This is not universal across all open system platforms, so you would need to test it on your system

Peter

A few minutes ago, I’ve tested the following construction on my SuSE-LINUX system:

| LPT4 80 66 32767 tee /export/home/user/file | lp    N |

That works, too. So you are not forced to use a LINUX-Script if you want to get a spool-file.

But printfile.$$ or printfile.date +%H%Mdoesn’t work.

Greetings from California! I also need help printing from Natural in Linux.
I am currently in the process of migrating several applications and Adabas files from Natural 3.16/Adabas 7.13 IBM VSE to Suse Linux Enterprise 9.1, with Natural 6.11/Adabas 3.3.2.02. I need to find a way of printing from several departments to several different printers. We have jobs that submit rje from batch and online in addition to batch jcl on the mainframe. We use a term-id based db on the mainframe to setup the list cards to point to correct printer and that works great, on the mainframe. Now to get something similar in Suse Linux. Currently we have 4 printers defined and I can print to them from direct commands at the command line but still cannot print from inside a natural program. I can create a file but I still cannot get the file to print. Our natparm is set as follows: (systems is the name of the printer)
Device Parameter Assignments ────────────────────────┐
│ Logical Line Page Max
│ Device Size Size Page Physical Device / Print to File? (Y/N)
│ -------- ---- ---- ----- -------------------------------------------------
│ VIDEO 80 24 32767 VIDEO N
│ LPT1 80 66 32767 $HOME/DefinePrinter.cat | lp -d systems Y
│ LPT2 80 66 32767 $HOME/DefinePrinter.cat Y
│ LPT3 80 66 32767 $HOME/Test.rpt Y

The program I am using to try and print is real simple:

define data local
1 test (a10)
end-define
test := ‘test print’
define printer(LPT1 = 1) OUTPUT ‘LPT1’
WRITE (1) TEST ‘SYSTEMS IS PRINTER LPT1 TEST FOR SJLH’
END

The file DefinePrinter.cat is created and looks like:

Page 1 05-10-17 16:17:31

test print SYSTEMS IS PRINTER LPT3 TEST FOR SJLH

But it doesn’t print… I have a file, but I need it to print without having to give another command, Shouldnt the natparm setting for LPT1 with | lp -d systems cause it to print from that file??? I have tried all kinds of commands, nothing seems to work. So I am asking for some help in this regard. Thanks in advance.
John