# reading the screen buffer

**URL:** <https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE, Natural-for-AJAX\
**Created:** [March 28, 2010, 12:11am UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177 "2010-03-28T00:11:29Z")\
**Posts on this page:** 8\
**Page:** 1

<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:** [March 28, 2010, 12:11am UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177/1 "2010-03-28T00:11:29Z")

</div>

Background: We run our 3270 sessions through CICS. When a NAT error occurs, we capture the error by calling CICS routine that reads the screen buffer and we save that to an ADABAS file. These errors are then routed to specific technical folks for resolution.

For terminal emulation under NJX, we run NJX through the BATCH WEB SERVER (NWO), but we cannot access the CICS routine (from the batch nwo) that will return the screen buffer. We have all kinds of problems with the CICS version of the NWO and it seems like the CICS NWO is a no go at the moment.

My question: is there a way to access what is on the screen (screen buffer) from Natural? I was hoping there would be a user exit somewhere that I could call that will return the screen buffer in an array or some such structure.

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [March 28, 2010, 5:33pm UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177/2 "2010-03-28T17:33:01Z")

</div>

Take a look at the %C family of commands. You can specify characteristics of what you are looking for (by color, intensity, line number, cursor, etc) and place found text on the stack or in \*com.

steve

---

<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:** [March 29, 2010, 12:49am UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177/3 "2010-03-29T00:49:37Z")

</div>

Thanks Steve! That is a great solution.

I am drawing a blank at the moment - can I read the source work area into an array with a user exit? I looked at the user exits but nothing seems like it would do that. I seem to remember reading about that sometime ago, but am drawing a blank on the details.

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [March 29, 2010, 6:49am UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177/4 "2010-03-29T06:49:27Z")

</div>

Hi Demos;

Look at: USR1057

steve

---

<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:** [March 29, 2010, 9:44pm UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177/5 "2010-03-29T21:44:07Z")

</div>

Hi Steve

Seems like USR1057 reads source from SYSTEM-FUSER. So to make this work will I have to save the content of the source work area to a temp name and then use USR1057 to read content.

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [March 30, 2010, 12:10am UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177/6 "2010-03-30T00:10:45Z")

</div>

You can combine a FOR loop with USR2014N to simulate a READ WORK of the Source Work Area. Sample code is available on the Forum at [url][http://tech.forums.softwareag.com/viewtopic.php?p=23223&sid=332f0c97cde0df52c164474c04453d3f#23223[/url]](http://tech.forums.softwareag.com/viewtopic.php?p=23223&sid=332f0c97cde0df52c164474c04453d3f#23223%5B/url%5D).

---

<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:** [March 30, 2010, 1:45am UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177/7 "2010-03-30T01:45:00Z")

</div>

Thanks Ralph. USR2014N will do the trick. Also thanks for the link to the code sample.

---

<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:58pm UTC](https://techcommunity.softwareag.com/t/reading-the-screen-buffer/93177/8 "2021-04-02T14:58:16Z")

</div>


