# Writing to channel 2 from NATURAL

**URL:** <https://techcommunity.softwareag.com/t/writing-to-channel-2-from-natural/61421>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [September 14, 2006, 12:38pm UTC](https://techcommunity.softwareag.com/t/writing-to-channel-2-from-natural/61421 "2006-09-14T12:38:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![E.Hofmann](https://avatars.discourse-cdn.com/v4/letter/e/df705f/32.png) [@E.Hofmann](https://techcommunity.softwareag.com/u/E.Hofmann)\
**Post date:** [September 14, 2006, 12:38pm UTC](https://techcommunity.softwareag.com/t/writing-to-channel-2-from-natural/61421/1 "2006-09-14T12:38:03Z")

</div>

Hello!  
Is it possible to define a second chanel with NATURAL for online printing (writing to channels in batch via workfiles is no problem)? We need it for AFP-forms with variable layouts.  
Thank you!  
E.Hofmann

---

<div class="post-metadata">

**Author:** ![Klaus\_Sponagel](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@Klaus\_Sponagel](https://techcommunity.softwareag.com/u/Klaus_Sponagel)\
**Post date:** [September 14, 2006, 2:20pm UTC](https://techcommunity.softwareag.com/t/writing-to-channel-2-from-natural/61421/2 "2006-09-14T14:20:37Z")

</div>

Hi  
With the profile parameter PRINT you can define up to 32 reports (what you presumably mean with channels) similar to work files.  
Using the DEFINE PRINTER statement you can dynamically assign a printer to each report.  
Hope this helps.

Klaus

---

<div class="post-metadata">

**Author:** ![E.Hofmann](https://avatars.discourse-cdn.com/v4/letter/e/df705f/32.png) [@E.Hofmann](https://techcommunity.softwareag.com/u/E.Hofmann)\
**Post date:** [September 14, 2006, 2:56pm UTC](https://techcommunity.softwareag.com/t/writing-to-channel-2-from-natural/61421/3 "2006-09-14T14:56:19Z")

</div>

Hello! I mean other channels within one report. In the spooled reports you find ‘1’ as channel 1 in line 1/column 1 for new page. We want zu write the channel-number at column 1 in any desired line of the report, for example:

1text1  
.text2  
.text3  
2text4

Best regards!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [September 14, 2006, 4:57pm UTC](https://techcommunity.softwareag.com/t/writing-to-channel-2-from-natural/61421/4 "2006-09-14T16:57:38Z")

</div>

Please refer to the documentation of the DEFINE PRINTER statement, and there to that of the “special printer” CCONTROL.

Printer-advance control characters can be generated within a Natural program by using the DEFINE PRINTER statement as follows:

```auto
.... DEFINE PRINTER (n) OUTPUT 'name' DEFINE PRINTER (n+1) OUTPUT 'CCONTROL' ....

Both DEFINE PRINTER statements work together so that all Natural output for the printer (n) follows the normal Natural report-output rules and all Natural output for the printer (n+1) is also written to the printer (n). Natural does not generate a printer-advance control character for this report. Therefore, the first character in the output variable is the control character.

With this method, it is possible to merge control characters for laser-printer systems and channel-advance characters for line printers in a normal Natural output report.
```

---

<div class="post-metadata">

**Author:** ![E.Hofmann](https://avatars.discourse-cdn.com/v4/letter/e/df705f/32.png) [@E.Hofmann](https://techcommunity.softwareag.com/u/E.Hofmann)\
**Post date:** [September 14, 2006, 7:55pm UTC](https://techcommunity.softwareag.com/t/writing-to-channel-2-from-natural/61421/5 "2006-09-14T19:55:07Z")

</div>

Hello again! Thank you for this solution.  
I’ve another question in this context: Is it possible to control the TRC parameter for the printer (in batch-mode i set it in JCL) in the writing NATURAL program?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/writing-to-channel-2-from-natural/61421/6 "2021-04-02T14:40:49Z")

</div>


