# Ruby and 3270 terminal emulation

**URL:** <https://www.ruby-forum.com/t/ruby-and-3270-terminal-emulation/132600>\
**Category:** Ruby\
**Created:** [March 21, 2008, 7:17pm UTC](https://www.ruby-forum.com/t/ruby-and-3270-terminal-emulation/132600 "2008-03-21T19:17:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [March 21, 2008, 7:17pm UTC](https://www.ruby-forum.com/t/ruby-and-3270-terminal-emulation/132600/1 "2008-03-21T19:17:26Z")

</div>

Hi all,

Are there any 3270 screen scraping libraries out there for Ruby? And  
do you have any suggestions on how to write one?

> **[IBM 3270](https://en.wikipedia.org/wiki/3270)**
>
> The IBM 3270 is a family of block oriented display and printer computer terminals introduced by IBM in 1971 and normally used to communicate with IBM mainframes. The 3270 was the successor to the IBM 2260 display terminal. Due to the text color on the original models, these terminals are informally known as green screen terminals. Unlike a character-oriented terminal, the 3270 minimizes the number of I/O interrupts required by transferring large blocks of data known as data streams, and IBM n...

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [March 22, 2008, 2:19am UTC](https://www.ruby-forum.com/t/ruby-and-3270-terminal-emulation/132600/2 "2008-03-22T02:19:03Z")

</div>

Some time ago when I needed to support 3270, I ended up using s3270 from  
[http://x3270.bgp.nu/](http://x3270.bgp.nu/) – this provides a scripting access to 3270  
protocol. You send 3270 requests to its standard input and it spits info  
and screen dumps to the standard output. In my TSC-ACT project at  
[TSC Acceptance Testing Framework (TACT) download | SourceForge.net](http://sourceforge.net/projects/tsc-act) I have 3270 integration via  
s3270, however there’s no official release yet (no easy installation and  
documentation yet). You can see an example of how I interact with s3270  
via IO::popen() in here:  
[TSC Acceptance Testing Framework (TACT) download | SourceForge.net](http://tsc-act.svn.sourceforge.net/viewvc/tsc-act/trunk/lib/tsc/session/s3270-stream.rb?revision=17&view=markup)

Please contact me off-list if you are interested in more details.

Gennady.

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [March 22, 2008, 4:33am UTC](https://www.ruby-forum.com/t/ruby-and-3270-terminal-emulation/132600/3 "2008-03-22T04:33:35Z")

</div>

On Mar 21, 7:14 pm, Gennady B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Some time ago when I needed to support 3270, I ended up using s3270 fromhttp://x3270.bgp.nu/-- this provides a scripting access to 3270 protocol. You send 3270 requests to its standard input and it spits info and screen dumps to the standard output. In my TSC-ACT project athttp://sourceforge.net/projects/tsc-actI have 3270 integration via s3270, however there’s no official release yet (no easy installation and documentation yet). You can see an example of how I interact with s3270 via IO::popen() in here:[TSC Acceptance Testing Framework (TACT) download | SourceForge.net](http://tsc-act.svn.sourceforge.net/viewvc/tsc-act/trunk/lib/tsc/sessi)…
> 
> Please contact me off-list if you are interested in more details.
> 
> Gennady.

Thank you for this. I will definitely take a look.

Dan

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [March 22, 2008, 7:50am UTC](https://www.ruby-forum.com/t/ruby-and-3270-terminal-emulation/132600/4 "2008-03-22T07:50:39Z")

</div>

On Mar 21, 12:16 pm, Daniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all,
> 
> Are there any 3270 screen scraping libraries out there for Ruby? And  
> do you have any suggestions on how to write one?
> 
> [IBM 3270 - Wikipedia](http://en.wikipedia.org/wiki/3270)
> 
> Regards,
> 
> Dan

If your emulator is Attachmate Extra, it has a built in  
macro language that can read the screen and type in  
data. This language can be invoked from Ruby or from  
the DOS-prompt with the command “ebrun”.

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [March 22, 2008, 11:43am UTC](https://www.ruby-forum.com/t/ruby-and-3270-terminal-emulation/132600/5 "2008-03-22T11:43:41Z")

</div>

Back in my mainframe days, I used the HLLAPI (aka WHLLPAI, aka  
HLLAPI32) interface of the terminal emulators to interact with the  
mainframe. Worked beautifully…

If you’re interested, I’m willing to extract the low-level code from  
my old projects.

gegroet,  
Erik V. - [http://www.erikveen.dds.nl/](http://www.erikveen.dds.nl/)

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [March 23, 2008, 12:21am UTC](https://www.ruby-forum.com/t/ruby-and-3270-terminal-emulation/132600/6 "2008-03-23T00:21:01Z")

</div>

On Sat, Mar 22, 2008 at 10:42 AM, Erik V. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Back in my mainframe days, I used the HLLAPI (aka WHLLPAI, aka  
> HLLAPI32) interface of the terminal emulators to interact with the  
> mainframe. Worked beautifully…

Ah yes! HLLAPI days 😉

Regards,  
Sean
