Scripting from 5250 terminal

As Green Screens Terminal is web based and support 5250 remote commands, some new interesting options become possible. One of them is to call JavaScript from 5250 application or a CL program.

See for short demonstration in following video first.

Before we start, it is mandatory to initialize remote command feature with STRPCO.

Now, for example, we can show notify or blocking popup informational message like in following examples.

Blocking Prompt

STRPCCMD PCCMD('script:Tn5250.Prompts.message(''Info'', ''Houston we have a problem'')')

Notify message

STRPCCMD PCCMD('script:Tn5250.Prompts.notify(''Houston we have a problem'')') 

Autostart printer

Web terminal supports spool to web PDF printing through remote OUTQ writer. To ease end client signing in, we can add a CL program to be called after users sign in. CL program will start printer session automatically.

STRPCCMD PCCMD('script:Tn5250.Application.startPrinter(''PRT01'')')

UI Customization

There are many new possibilities like screen customization and scripting. For example,
we can make screen to blink and trigger beep sound directly from CL program in a case of program error.

STRPCCMD PCCMD('script:$(".tnview").fadeIn(50).fadeOut(50).fadeIn(50).fadeOut(50).fadeIn(50);Tn5250.OIA.beep();')                    

Disabling features

Green Screens Web Administration have customization option where we can add our custom CSS styling and scripts which applies to all workstations. Even there are options to call custom script for specific workstation or specific user, sometimes it is required that those functions are called from STRRMTCMD. Let's say that we have a telnet initialization CL program which can call web terminal functions based on some system data.

Let us show two different approaches for disabling key bar.

Open web admin console, click on Customization icon on top bar and in tab Footer add following:

$(window).on('greenscreens', function() {

Similar effect we can get by adding following to our CL program started when user signs on.

STRPCCMD PCCMD('script:Tn5250.KeyBar.toggle()') PAUSE(*NO)

The difference is that the first example is applied for all host configurations, while the second example will work only for the system on which this script is executed.


There are many options for scripting. To simplify tasks, any client can create it's own set of JavaScript functions and make them available as custom injectable scripts inside web terminal. Those custom scripts can be triggered from 5250 application (CL, RPG, COBOL etc..)

Even shown scripts are simple, more complex code and automation scripts can be created to simplify data entry or to automate integration etc.